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.8k
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
2025年春に見直したい、リソース最適化の基本
sogaoh
PRO
0
590
最近のSRE支援ニーズ考察 | sogaoh's LT @ Road to SRE NEXT@札幌
sogaoh
PRO
1
280
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
350
複業SRE、どこまでいける?++
sogaoh
PRO
0
84
複業SRE、どこまでいける?
sogaoh
PRO
0
390
Webアプリケーション周りのいろいろなアップグレード戦記
sogaoh
PRO
0
200
NPOと取り組むスモールスタートな業務IT化 | TRACK C8
sogaoh
PRO
0
100
業務委託やコミュニティメンバーでも活用できる IAM Identity Center
sogaoh
PRO
0
1.6k
PHPプロダクトのDeployをラクにするCLIツールたち
sogaoh
PRO
1
770
Other Decks in Programming
See All in Programming
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
460
Rails Frontend Evolution: It Was a Setup All Along
skryukov
0
320
Jakarta EE Meets AI
ivargrimstad
0
270
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
690
AIコーディングエージェント全社導入とセキュリティ対策
hikaruegashira
12
7.2k
iOS開発スターターキットの作り方
akidon0000
0
180
テスターからテストエンジニアへ ~新米テストエンジニアが歩んだ9ヶ月振り返り~
non0113
2
240
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
13k
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
290
Android 16KBページサイズ対応をはじめからていねいに
mine2424
0
640
Vibe Codingの幻想を超えて-生成AIを現場で使えるようにするまでの泥臭い話.ai
fumiyakume
18
9.2k
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
110
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
How STYLIGHT went responsive
nonsquared
100
5.6k
Designing Experiences People Love
moore
142
24k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Gamification - CAS2011
davidbonilla
81
5.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Faster Mobile Websites
deanohume
308
31k
Practical Orchestrator
shlominoach
189
11k
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