$30 off During Our Annual Pro Sale. View Details »
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
わりとなんでもできちゃう Fargate Spot bastion (with ecsta とか) | sogaoh's LT @ キチピー リジェクトコン【非公式】 2025
sogaoh
PRO
0
69
2025年春に見直したい、リソース最適化の基本
sogaoh
PRO
0
760
最近のSRE支援ニーズ考察 | sogaoh's LT @ Road to SRE NEXT@札幌
sogaoh
PRO
1
330
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
400
複業SRE、どこまでいける?++
sogaoh
PRO
0
110
複業SRE、どこまでいける?
sogaoh
PRO
0
430
Webアプリケーション周りのいろいろなアップグレード戦記
sogaoh
PRO
0
230
NPOと取り組むスモールスタートな業務IT化 | TRACK C8
sogaoh
PRO
0
120
業務委託やコミュニティメンバーでも活用できる IAM Identity Center
sogaoh
PRO
0
1.7k
Other Decks in Programming
See All in Programming
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
110
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
2k
しっかり学ぶ java.lang.*
nagise
1
470
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
5
16k
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
110
関数の挙動書き換える
takatofukui
4
760
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
200
JJUG CCC 2025 Fall: Virtual Thread Deep Dive
ternbusty
3
510
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 1
philipschwarz
PRO
0
120
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
32
15k
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
590
スタートアップを支える技術戦略と組織づくり
pospome
8
14k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Become a Pro
speakerdeck
PRO
30
5.7k
Mobile First: as difficult as doing things right
swwweet
225
10k
Automating Front-end Workflow
addyosmani
1371
200k
It's Worth the Effort
3n
187
29k
How to train your dragon (web standard)
notwaldorf
97
6.4k
How STYLIGHT went responsive
nonsquared
100
5.9k
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