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
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
210
複業SRE、どこまでいける?++
sogaoh
PRO
0
48
複業SRE、どこまでいける?
sogaoh
PRO
0
320
Webアプリケーション周りのいろいろなアップグレード戦記
sogaoh
PRO
0
170
NPOと取り組むスモールスタートな業務IT化 | TRACK C8
sogaoh
PRO
0
85
業務委託やコミュニティメンバーでも活用できる IAM Identity Center
sogaoh
PRO
0
1.5k
PHPプロダクトのDeployをラクにするCLIツールたち
sogaoh
PRO
1
730
Laravelプロダクト Fargate化への道
sogaoh
PRO
2
1.3k
本番でしか起きない問題に早く気が付けるように、僕は Laravel Dusk で CI する
sogaoh
PRO
0
920
Other Decks in Programming
See All in Programming
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
190
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
150
Spring gRPC について / About Spring gRPC
mackey0225
0
220
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
CI改善もDatadogとともに
taumu
0
120
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
110
Ruby on cygwin 2025-02
fd0
0
140
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
740
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
47
17k
GAEログのコスト削減
mot_techtalk
0
120
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
390
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
RailsConf 2023
tenderlove
29
1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
174
51k
GraphQLとの向き合い方2022年版
quramy
44
13k
Why Our Code Smells
bkeepers
PRO
336
57k
Facilitating Awesome Meetings
lara
52
6.2k
A Philosophy of Restraint
colly
203
16k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Producing Creativity
orderedlist
PRO
344
39k
Visualization
eitanlees
146
15k
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