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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hisashi SOGA
PRO
September 01, 2017
Programming
2.9k
2
Share
Ansible-Playbook-CleanUp-WinUpd-TempFiles
Windows Update の中間ファイル(ゴミ)を Ansible Playbook で一発で掃除することができるので事例を紹介します
Hisashi SOGA
PRO
September 01, 2017
More Decks by Hisashi SOGA
See All by Hisashi SOGA
2026年春から始めるOpenTelemetry | sogaoh's LT @ PHP Conference ODAWARA 2026
sogaoh
PRO
0
120
わが10年の叡智をぶつけたカオスなクラウドインフラが、なくなるということ。
sogaoh
PRO
1
1.5k
厳しい現実のクラウドインフラを理想形に引き戻そうとした120日 | sogaoh's session @ YAPC::Fukuoka 非公式リジェクトコン
sogaoh
PRO
0
130
わりとなんでもできちゃう Fargate Spot bastion (with ecsta とか) | sogaoh's LT @ キチピー リジェクトコン【非公式】 2025
sogaoh
PRO
0
110
2025年春に見直したい、リソース最適化の基本
sogaoh
PRO
0
1.1k
最近のSRE支援ニーズ考察 | sogaoh's LT @ Road to SRE NEXT@札幌
sogaoh
PRO
1
390
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
1
470
複業SRE、どこまでいける?++
sogaoh
PRO
0
130
複業SRE、どこまでいける?
sogaoh
PRO
0
470
Other Decks in Programming
See All in Programming
Vibe NLP for Applied NLP
inesmontani
PRO
0
430
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
220
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
570
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
550
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
380
GitHubCopilotCLIをはじめよう.pdf
htkym
0
180
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
140
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
810
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3k
実用!Hono RPC2026
yodaka
2
230
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
370
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
710
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.3k
Automating Front-end Workflow
addyosmani
1370
200k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
Tell your own story through comics
letsgokoyo
1
900
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
440
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
69
39k
sira's awesome portfolio website redesign presentation
elsirapls
0
220
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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