Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ansible-Playbook-CleanUp-WinUpd-TempFiles
Search
Hisashi SOGA
PRO
September 01, 2017
Programming
2
2.7k
Ansible-Playbook-CleanUp-WinUpd-TempFiles
Windows Update の中間ファイル(ゴミ)を Ansible Playbook で一発で掃除することができるので事例を紹介します
Hisashi SOGA
PRO
September 01, 2017
Tweet
Share
More Decks by Hisashi SOGA
See All by Hisashi SOGA
最近のSRE支援ニーズ考察 | sogaoh's LT @ Road to SRE NEXT@札幌
sogaoh
PRO
0
4
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
220
複業SRE、どこまでいける?++
sogaoh
PRO
0
51
複業SRE、どこまでいける?
sogaoh
PRO
0
330
Webアプリケーション周りのいろいろなアップグレード戦記
sogaoh
PRO
0
170
NPOと取り組むスモールスタートな業務IT化 | TRACK C8
sogaoh
PRO
0
87
業務委託やコミュニティメンバーでも活用できる IAM Identity Center
sogaoh
PRO
0
1.5k
PHPプロダクトのDeployをラクにするCLIツールたち
sogaoh
PRO
1
730
Laravelプロダクト Fargate化への道
sogaoh
PRO
2
1.3k
Other Decks in Programming
See All in Programming
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
250
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.6k
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
170
Django NinjaによるAPI開発の効率化とリプレースの実践
kashewnuts
1
280
Go 1.24でジェネリックになった型エイリアスの紹介
syumai
2
300
color-scheme: light dark; を完全に理解する
uhyo
7
500
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
990
SwiftUI Viewの責務分離
elmetal
PRO
2
280
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
250
.NET Frameworkでも汎用ホストが使いたい!
tomokusaba
0
200
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
140
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Bash Introduction
62gerente
611
210k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Documentation Writing (for coders)
carmenintech
67
4.6k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
4 Signs Your Business is Dying
shpigford
182
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
133
33k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Transcript
Windows Update ͷதؒϑΝΠϧ(ΰϛ)Λ Ansible Playbook ͰҰൃͰআ͢Δ 2017/09/01 @sogaoh 1 Presentation
Slide at https://ansible-users.connpass.com/event/62508/
AGENDA • ࣗݾհ • લఏ • ઃఆ • ࣮ߦ •
ҙ • ͓ΘΓʹ 2
ࣗݾհ • ીզɹԝ / Hisashi SOGA – Twitter : @sogaohɹ,
GitHub : sogaoh • Marketing Applications, Inc. / MApps – WebΞϯέʔτ࡞ɾ৴αʔϏε forSurvey – एճऩࠃNo.1ͷ MApps Panel • DevOpsਪਐࣨ (ফୂ ) – Πϯϑϥ ʛ˛˕˛˛˗˛ʵʛ ΞϓϦ – ϑϩϯτ ʛʵʵʵ˛˗˕˛ʛ αʔό ɹ 3 ◆࠷ॳ ˛कඋൣғ ˕ΠϚίί
લఏ • ※࣮ͨ͠ͷ͕̍͘Β͍લͰ͢ • Ansible (Server) ଆ (Playbook࣮ߦڥ) – CentOS
7.2, ansible 2.1.0.0, Python 2.7 • Windows (Agent) ଆ – Powershell 3 Ҏ্ (5 ΛೖΕͨ) – Win 2008 R2 ʹΠϯετʔϧ͕ඞཁɹɹɹɹɹ (2.0͕σϑΥϧτ) 4
ઃఆ (1) • Windows (Agent) ଆ • ઃఆεΫϦϓτμϯϩʔυ • ઃఆεΫϦϓτ࣮ߦ
• AllowUnencrypted="true"Λઃఆ 5 PS> Invoke-WebRequest -Uri https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ ConfigureRemotingForAnsible.ps1 -OutFile ConfigureRemotingForAnsible.ps1 PS> powershell -ExecutionPolicy RemoteSigned ./ConfigureRemotingForAnsible.ps1 PS C:\tmp> winrm set winrm/config/service '@{AllowUnencrypted="true"}'
ઃఆ (2) • Ansible (Server)ଆ • pywinrm ͷΠϯετʔϧ • Winଆͷࣗݾূ໌ॻݕূΛεΩοϓ͢ΔઃఆΛೖΕΔ
• /opt/ansible_win/ansible.cfg • ඌʹهɹɹɹɹɹɹɹɹɹɹɹͦͷଞௐ 6 $ sudo mkdir -p /opt/ansible/callback_plugins $ sudo vim /opt/ansible/callback_plugins/fix-ssl.py [defaults] bin_ansible_callbacks=True callback_plugins = ./callback_plugins ansible_winrm_server_cert_validation=ignore $ sudo pip install pywinrm inventory = /opt/ansible_win/hosts host_key_checking = False
࣮ߦ • ૄ௨֬ೝ • ࣮ߦ 7 ansible win-host-01 -m win_ping
env ANSIBLE_CONFIG=/opt/ansible_win/ansible.cfg ansible- playbook ./cleanup-win-update-tmp-files.yml -l win-host-01 env ANSIBLE_CONFIG=/opt/ansible_win/ansible.cfg ansible- playbook ./cleanup-win-installer-tmp-files.yml -l win-host-01 refs: https://github.com/sogaoh/AnsiblePractice/tree/master/operation/windows
ҙ • Οϧεରࡦιϑτ͕ೖ͍ͬͯΔ߹ • ϙʔτ5985, 5986 ͷղ์͕ඞཁ • ΞϯΠϯετʔϧ͕Ͱ͖ͳ͘ͳΔ •
ʮΓ͢ʯՄೳੑ͕͋ΔڥͰ࣮ߦ ʹҙɾݕূ͕ඞཁ 8
͓ΘΓʹ • Windows ʹର͢ΔఆܕԽ͞Ε͍ͯΔΦϖϨʔ γϣϯɺ͖ͬͱࣗಈԽɾ؆ૉԽͰ͖Δ • ଞʹɺAnsible ͰҎԼͷΑ͏ͳ͜ͱΛ؆ૉԽ͠ ͓ͯΓɺ୭ͰͰ͖Δମ੍Λ͍͑ͯ·͢ •
BIND ͷόʔδϣϯΞοϓ • STNS ΫϥΠΞϯτͷηοτΞοϓ • ͜ΜͳνʔϜʹjoin͍ͨ͠ͱࢥͬͨํ↓ͥͻɹ 9 https://jp.stanby.com/ats/marketing-applications/jobs