Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ansible 2.0 at Ansible Meetup in Tokyo 2015.09
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
shirou
September 14, 2015
Technology
8.8k
10
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ansible 2.0 at Ansible Meetup in Tokyo 2015.09
shirou
September 14, 2015
More Decks by shirou
See All by shirou
Sphinx-themes.org in Sphinx-con 2018
shirou
0
2.4k
Generate better JavaScript From Goa Design
shirou
0
1.4k
sphinxからAnsible Playbookを読み込む
shirou
3
720
ansible x sphinx for ssmjp-2016-07-29 but-not-used
shirou
0
160
Sphinx with Markdown
shirou
2
25k
code generation from C in gopsutil
shirou
1
6.4k
Other Decks in Technology
See All in Technology
特殊変数大全
dak2
0
160
Harness Engineering on Rails
joelq
0
730
CI/CDではもう遅い - 人とAIが迂回しないDevSecOps Verify基盤の再設計 -
kintotechdev
1
390
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
340
キャリアLT今日までそして明日から
kentapapa
1
100
Azure Copilot Resiliency Agentをいろいろ試してみる
tomokusaba
0
130
AIに賢く動いてもらうためのコンテキスト〜Snowflake女子会 vol.8
snowwmn0824
0
190
IR Today: Theory, Practice, and Agents
dtunkelang
0
220
Terraformを用いたJamf Pro構成のIaC, GitOps化への挑戦
yukun
0
110
.NET WebAssemblyで実現するクライアントサイドAI推論:NuGetからViteまで、2つのエコシステムを繋ぐビルド戦略
yamachu
1
1k
Mastering Agentic Development: Harness Engineering for Effective Coding Agents
konippi
3
620
GoのInterface内部構造から学ぶ!最高パフォーマンスを出すコード設計
yappli_developers
1
300
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
1.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
780
Agile that works and the tools we love
rasmusluckow
331
22k
Odyssey Design
rkendrick25
PRO
2
830
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
450
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
250
We Are The Robots
honzajavorek
0
380
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Transcript
Ansible 2.0 @r_rudi एࢁ࢙ (πΩϊϫגࣜձࣾ)
͓લͩΕΑ • एࢁ ࢙@r_rudi / πΩϊϫגࣜձࣾ CTO • WebΞϓϦ։ൃ͔Βӡ༻·Ͱ •
ීஈgolangͰWebΞϓϦॻ͍ͯ·͢ • ஶॻʮೖAnsibleʯ • Amazonʹͯൢചத(ిࢠॻ੶)
Ansible 2.0ͱ • ࠷৽1.9.3 (1.9.4͕rc2) • 1ܥͱฏߦͯ͠2ܥ͕͍ؒ։ൃ͞Ε͍ͯͨ • গͳ͘ͱࠓ2݄Ҏ߱ •
෦ߏΛ΄΅Ұ͔Βॻ͖ͨ͠ • ίʔυ໊: ”Over the Hills and Far Away” (Led Zeppelin)
2.0Ͱ࠷ॏཁͳ • ࠓ͜Ε͚ͩΛ֮͑ͯؼͬͯԼ͍͞ • ैདྷͷplaybookͱ100%ޓੑ͕͋Γ·͢ • طଘͷplaybookΛม͑Δඞཁ͋Γ·ͤΜ Λɺࢦ͍ͯ͠·͢
Ճػೳ
block • taskΛ͞ΒʹׂͰ͖·͢ tasks: - block: - yum: name={{ item
}} state=installed with_items: - httpd - memcached - template: src=templates/src.j2 dest=/etc/foo.conf - service: name=bar state=started enabled=True when: ansible_distribution == 'CentOS'
blockʹΑΔྫ֎ॲཧ tasks: - block: - debug: msg='࣮ߦ͞Ε·͢' - fail: msg=“fail!!!”
- debug: msg=‘Τϥʔ͕ى͖ΔͨΊɺ࣮͜͜ߦ͞Ε·ͤΜ' rescue: - debug: msg=‘Τϥʔ͕͓͖·ͨ͠' - fail: msg=“rescueͰfail!!” - debug: msg='࣮͜͜ߦ͞Ε·ͤΜ' always: - debug: msg="ඞ࣮ͣߦ͞Ε·͢"
blockͰઃఆͷ্ॻ͖ - hosts: remote_user: someuser tasks: - block: - shell:
whoami - shell: touch /etc/hosts become_user: root
strategy plugin • λεΫ࣮ߦઓུΛมߋ͢Δ • linear: શϗετͷ࣮ߦऴྃΛͭ(v1ͱಉ͡) • free: ͨͣʹͲΜͲΜ࣮ߦ͍ͯ͘͠
• pluginͳͷͰɺՃՄೳ
includeͰwith͕͑ΔΑ͏ʹ • includeมΛ্ॻ͖Ͱ͖͕ͨɺwithʹΑΔ ܁Γฦ͠Ͱ͖ͳ͔ͬͨɻ tasks: - include: foo.yml some_var={{ item
}} with_items: [‘a’, ‘b’, ‘c’]
includeͰมΛ͏ • ैདྷมల։͕ग़དྷͳ͔ͬͨ • distributionຖʹwhenΛॻ͘ΑΓߦઅ - include: included_{{ inventory_hostname }}.yml
meta: refresh_inventory • inventoryϑΝΠϧ࠷ॳͷҰճ͔͠ಡΈࠐ· ͳ͔ͬͨ • dynamic inventoryͳͲͰʹ tasks:
- meta: refresh_inventory
taskϨϕϧͰͷม • taskϨϕϧͰఆٛɾ্ॻ͖͕Մೳʹ vars: aa: "AA" tasks: - debug: msg="{{
aa }}" - debug: msg="{{ aa }}" vars: aa: “BB" - debug: msg="{{ aa }}” -> AA -> BB -> AA
Ϟδϡʔϧ/pluginͷՃ • 140Ҏ্ͷ৽نϞδϡʔϧͷՃ • openstackɺdockerɺzabbixɺvmware… • inventory, connection pluginՃ •
serf, consul, dockerͳͲ • callback plugin͕ಉࠝɻansible.cfgʹॻ͚ͩ͘Ͱ༗ޮ Խ(callback_whitelist)
ྫ: profile_tasks plugin [defaults] callback_whitelist = profile_tasks TASK [debug msg={{
aa }}] ****************************************************** Monday 14 September 2015 16:00:20 +0900 (0:00:00.074) 0:00:00.162 ****** ok: [localhost] => { "changed": false, "msg": "AA" } Monday 14 September 2015 16:00:20 +0900 (0:00:00.078) 0:00:00.241 ****** =============================================================================== TASK: debug msg={{ aa }} ------------------------------------------------ 0.08s TASK: debug msg={{ aa }} ------------------------------------------------ 0.08s TASK: debug msg={{ aa }} ------------------------------------------------ 0.07s
มߋ෦
෦ߏͷཧ • มཧ (VariableManager) • ैདྷมͷཧʹ͕ଟ͔ͬͨ • มల։ͷॱং͕͔ΓͮΒ͔ͬͨ • pluginߏͷཧ
• ܧঝߏͷཧ
෦APIͷมߋ • ࣗ࡞pluginʹଟগͷมߋ͕ඞཁ • lookupLookupBase classΛܧঝ͢ΔΑ͏ʹ • callback ‘v2_’ Λ͚Δ
• connection΄ͱΜͲͷਓ͕࡞͍ͬͯͳ͍ͣ • filterมߋͳ͠
ࣗ࡞Ϟδϡʔϧ • Ҿͷ͠ํ͕มΘͬͨͷͰɺมߋ͕ඞཁʹ ͳΓ·͢ • http://qiita.com/h-hirokawa/items/ 8eecd64d01ad80175179
ࡉ͔ͳมߋ • templateͰboolΛจࣈܕʹม͍͕ͯͨ͠ɺม ߋ͠ͳ͍Α͏ʹ • ۭͷมͱNoneΛۭനʹม͍͕ͯͨ͠ɺมߋ͠ͳ͍ Α͏ʹ • jinja2ͰͷΤεέʔϓͰ \\
ͱ͍ͯͨ͠ͷΛ \ ʹ • YAMLϑΝΠϧதͰ > Λ͍ͬͯͨ߹ʹ࠷ޙͷվߦ Λͦͷ··͢Α͏ʹ
python 3ରԠ • ೦ͳ͕ΒೖΓ·ͤΜͰͨ͠ • ͨͩ͠ɺ४උਐΊ͍ͯΔ༷ࢠ • python 3ରԠPRΛड͚ೖΕ͍ͯΔ
·ͱΊ • Ansible 2.0ɻ·ͩग़ͯ·ͤΜɻɻɻ • playbookͷޓੑ 100% • 140Ҏ্ͷϞδϡʔϧͷՃ •
blockʹΑΔྫ֎ॲཧͷՃ • ࣗ࡞ͷpluginʹमਖ਼͕ඞཁ
એ: PythonΤϯδχΞཆಡຊ • AnsibleͷΛॻ͍ͯ·͢ • 9݄17ʹansibleষͷಡॻձΛΓ·͢ • http://pymook.connpass.com/ • ͋Β͔͡ΊಡΜͰ͖ͯؾʹͳͬͨɺΘ͔Βͳ͔ͬ
ͨͱ͜ΖΛஶऀʹฉ͘ձͰ͢