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とテスト
Search
volanja
September 22, 2014
Technology
8
2.6k
Ansibleとテスト
Ansible Meetup in Tokyo 2014.09
volanja
September 22, 2014
Tweet
Share
Other Decks in Technology
See All in Technology
Oracle Database Technology Night #87-1 : Exadata Database Service on Exascale Infrastructure(ExaDB-XS)サービス詳細
oracle4engineer
PRO
1
220
Snowflake ML モデルを dbt データパイプラインに組み込む
estie
0
120
AIエージェント時代のエンジニアになろう #jawsug #jawsdays2025 / 20250301 Agentic AI Engineering
yoshidashingo
9
4.1k
MLflowはどのようにLLMOpsの課題を解決するのか
taka_aki
0
130
Introduction to OpenSearch Project - Search Engineering Tech Talk 2025 Winter
tkykenmt
2
220
Global Databaseで実現するマルチリージョン自動切替とBlue/Greenデプロイ
j2yano
0
160
サバイバルモード下でのエンジニアリングマネジメント
konifar
21
7.2k
アジリティを高めるテストマネジメント #QiitaQualityForward
makky_tyuyan
1
350
Amazon Athenaから利用時のGlueのIcebergテーブルのメンテナンスについて
nayuts
0
110
困難を「一般解」で解く
fujiwara3
8
2.2k
いまからでも遅くない!コンテナでWebアプリを動かしてみよう!コンテナハンズオン編
nomu
0
180
データエンジニアリング領域におけるDuckDBのユースケース
chanyou0311
9
2.6k
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
380
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1.1k
Six Lessons from altMBA
skipperchong
27
3.6k
For a Future-Friendly Web
brad_frost
176
9.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Become a Pro
speakerdeck
PRO
26
5.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Transcript
Ansible Meetup in Tokyo 2014.09 LT ʮAnsibleͱςετʯ @volanja
Introduction • Twitter / Github / Qiita : volanja •
Ansibleྺ:1 (≒Github/Qiitaྺ) • QiitaʮAnsilbeͰ࡞ΔGitlab+RedmineʯͳͲɻ • Ansible Advent Calendar 2013 ࡢɺͬͯΈ·ͨ͠ɻ࠷ॳͱ࠷ޙͷਓͰ͢ɻ
Thank you All Author!!
Ansibleͬͯ·͔͢ʁ
ςετͲ͏ͯ͠·͔͢ʁ
Severspec http://serverspec.org/
ansible_spec https://rubygems.org/gems/ansible_spec
ansible_spec • RubyίϚϯυϥΠϯπʔϧͰ͢ɻ AnsibleͱServerspecΛΈ߹Θͤͯ͏ͨΊͷɺ Rakefileͱspec_helper.rbΛ࡞͠·͢ɻ • ServerspecɺAnsibleͷInventoryFile͔ΒରϗετΛɺ playbook͔ΒରϩʔϧΛɺಡΈࠐΜͰςετΛ࣮ߦ͠·͢ɻ $ gem
install ansible_spec $ ansiblespec_init create spec create spec/spec_helper.rb create Rakefile create .ansiblespec
ᵓᴷᴷ hostsɹɹ(Inventoryfile) ᵓᴷᴷ site.yml (playbook) ᵓᴷᴷ roles ᴹ ᵋᴷᴷ nginx
ᴹ ᵋᴷᴷ spec ᴹ ᵋᴷᴷ nginx_spec.rb ᴹ ᵋᴷᴷ tasks ᴹ ᵋᴷᴷ main.yml ᵓᴷᴷ Rakefile ᵓᴷᴷ spec ᵋᴷᴷ spec_helper.rb ᵋᴷᴷ .ansiblespecɹɹɹ(playbook, inventoryfileΛઃఆ͢ΔϑΝΠϧ) AnsibleͱServerspec Ansible Serverspec σΟϨΫτϦߏ(like BestPractise) by https://github.com/volanja/ansible-sample-tdd
࣮ߦ $ ansible-playbook site.yml -i hosts ! PLAY [Ansible-Sample-TDD] *****************************************************
GATHERING FACTS *************************************************************** ok: [192.168.0.103] (লུ) PLAY RECAP ******************************************************************** 192.168.0.103 : ok=10 changed=9 unreachable=0 failed=0 $ rake serverspec:Ansible-Sample-TDD Run serverspec for Ansible-Sample-TDD to 192.168.0.103 /Users/Adr/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -S rspec roles/nginx/spec/nginx_spec.rb ........... Finished in 0.79885 seconds 11 examples, 0 failures
$ ansible-playbook site.yml -i hosts ! PLAY [Ansible-Sample-TDD] ***************************************************** GATHERING
FACTS *************************************************************** ok: [192.168.0.103] (লུ) PLAY RECAP ******************************************************************** 192.168.0.103 : ok=10 changed=9 unreachable=0 failed=0 $ rake serverspec:Ansible-Sample-TDD Run serverspec for Ansible-Sample-TDD to 192.168.0.103 /Users/Adr/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -S rspec roles/nginx/spec/nginx_spec.rb ........... Finished in 0.79885 seconds 11 examples, 0 failures site.yml is playbook - name: Ansible-Sample-TDD ࣮ߦ
$ ansible-playbook site.yml -i hosts ! PLAY [Ansible-Sample-TDD] ***************************************************** GATHERING
FACTS *************************************************************** ok: [192.168.0.103] (লུ) PLAY RECAP ******************************************************************** 192.168.0.103 : ok=10 changed=9 unreachable=0 failed=0 $ rake serverspec:Ansible-Sample-TDD Run serverspec for Ansible-Sample-TDD to 192.168.0.103 /Users/Adr/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -S rspec roles/nginx/spec/nginx_spec.rb ........... Finished in 0.79885 seconds 11 examples, 0 failures hosts is InventoryFile [Server] 192.168.0.103 ࣮ߦ
• GemͷৄࡉҎԼͷϖʔδΛޚཡ͍ͩ͘͞ɻ Github volanja/ansible_spec https://github.com/volanja/ansible_spec • NginxͱMariaDBΛΠϯετʔϧ͢Δαϯϓϧ͕͋Γ·͢ɻ Githubɹvolanja/ansible-sample-tdd https://github.com/volanja/ansible-sample-tdd
ͱ͜ΖͰɺ AnsibleͱผͷςετπʔϧඞཁͰ͠ΐ͏͔ʁ
Testing Strategies • Ansible » Docs » Testing Strategies http://docs.ansible.com/test_strategies.html
• Conclusion “Ansible believes you should not need another framework to validate basic things of your infrastructure is true.” • modules for Test assert, register, when, fail
Έͳ͞ΜͲ͏͍ͯ͠·͔͢ʁ
Welcome to Ansible Advent Calendar 2014 at Qiita or ATND
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ དྷ݄ʹServerspec v2͕ग़ΔͷͰɺ ͝հͨ͠Gemಈ͔ͳ͘ͳΔ͔͠Ε·ͤΜorz….