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
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.3k
Other Decks in Technology
See All in Technology
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
730
品質と信頼性を地続きにする
grimoh
0
460
Claude Code本って、 読む必要あるの?
oikon48
2
470
あけおめLINE 傾向とその対策
nasa9084
0
100
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.9k
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
130
銀行勘定系システムにおける開発プロセス刷新×AIによる環境モダナイゼーション / Development Process Transformation and AI-Driven Environment Modernization
muit
0
2.2k
20260912_スクフェス三河
kgnkhkr
0
380
絵ではじめるKubernetesセキュリティ
aoi1
3
620
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
150
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
330
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
630
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
580
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
Facilitating Awesome Meetings
lara
57
7.1k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Claude Code のすすめ
schroneko
67
230k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Become a Pro
speakerdeck
PRO
31
6.3k
WENDY [Excerpt]
tessaabrams
14
39k
GraphQLとの向き合い方2022年版
quramy
50
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
My Coaching Mixtape
mlcsv
0
310
Into the Great Unknown - MozCon
thekraken
41
2.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/ • ͋Β͔͡ΊಡΜͰ͖ͯؾʹͳͬͨɺΘ͔Βͳ͔ͬ
ͨͱ͜ΖΛஶऀʹฉ͘ձͰ͢