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
20241125 - AI 繪圖實戰魔法工作坊 @ 實踐大學
dpys
1
430
いまからでも遅くないコンテナ座学
nomu
0
190
Fabric 移行時の躓きポイントと対応策
ohata_ds
1
110
The future we create with our own MVV
matsukurou
0
780
12 Days of OpenAIから読み解く、生成AI 2025年のトレンド
shunsukeono_am
0
970
エンジニアリングマネージャー視点での、自律的なスケーリングを実現するFASTという選択肢 / RSGT2025
yoshikiiida
4
1.9k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
6
54k
Denoで作るチーム開発生産性向上のためのCLIツール
sansantech
PRO
0
120
AWSの生成AIサービス Amazon Bedrock入門!(2025年1月版)
minorun365
PRO
6
290
最近のSfM手法まとめ - COLMAP / GLOMAPを中心に -
kwchrk
8
1.7k
ソフトウェア開発における「パーフェクトな意思決定」/Perfect Decision-Making in Software Development
yayoi_dd
2
2.6k
信頼されるためにやったこと、 やらなかったこと。/What we did to be trusted, What we did not do.
bitkey
PRO
0
930
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
220
Code Reviewing Like a Champion
maltzj
521
39k
For a Future-Friendly Web
brad_frost
176
9.5k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Designing for humans not robots
tammielis
250
25k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Designing for Performance
lara
604
68k
The Cost Of JavaScript in 2023
addyosmani
46
7.1k
Fireside Chat
paigeccino
34
3.1k
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….