Upgrade to Pro — share decks privately, control downloads, hide ads and more …

空前絶後のォォ!超絶怒濤のAnsible/fukuten-20170127

 空前絶後のォォ!超絶怒濤のAnsible/fukuten-20170127

Fukuoka.NET #5 2017/1/27 LT資料です。

Kunihiro Morita

January 27, 2017
Tweet

More Decks by Kunihiro Morita

Other Decks in Technology

Transcript

  1. module Πϯετʔϧ΍αʔϏεىಈͳͲίϚϯυͷ෦෼ 4 yum 4 service $ ansible -i hosts

    web -m ping 192.168.0.10 | success >> { "changed": false, "ping": "pong" } 2017/1/27 Fukuoka.NET (Fukuten) #5 14
  2. playbook ϞδϡʔϧΛ࣮૷࣮ͯ͠ߦ͢Δ෦෼ - hosts: web sudo: yes tasks: - name:

    be sure httpd is installed yum: name=httpd state=installed - name: be sure httpd is running and enabled service: name=httpd state=running enabled=yes 2017/1/27 Fukuoka.NET (Fukuten) #5 15
  3. playbook࣮ߦ $ ansible-playbook -i hosts simple.yml PLAY [web] ************************************************************ GATHERING

    FACTS *************************************************************** ok: [192.168.0.10] TASK: [be sure httpd is installed] ******************************************** changed: [192.168.0.10] TASK: [be sure httpd is running and enabled] ********************************** changed: [192.168.0.10] PLAY RECAP ******************************************************************** 192.168.0.10 : ok=3 changed=2 unreachable=0 failed=0 2017/1/27 Fukuoka.NET (Fukuten) #5 16
  4. playbook - hosts: localhost connection: local gather_facts: no tasks: -

    name: tap homebrew cask homebrew_tap: tap=caskroom/cask state=present - name: install homebrew-cask homebrew: name=brew-cask state=latest - name: install dockertoolbox homebrew_cask: name=dockertoolbox state=present 2017/1/27 Fukuoka.NET (Fukuten) #5 19
  5. playbook࣮ߦ $ ansible-playbook -i hosts localhost.yml -vv PLAY [localhost] **************************************************************

    TASK: [tap homebrew cask] ***************************************************** <localhost> REMOTE_MODULE homebrew_tap tap=caskroom/cask state=present CHECKMODE=True ok: [localhost] => {"changed": false, "msg": "added: 0, unchanged: 1"} TASK: [install homebrew-cask] ************************************************* <localhost> REMOTE_MODULE homebrew name=brew-cask state=latest CHECKMODE=True ok: [localhost] => {"changed": false, "msg": "Package is already upgraded: brew-cask"} TASK: [install dockertoolbox] ************************************************ <localhost> REMOTE_MODULE homebrew_cask name=dockertoolbox state=present CHECKMODE=True changed: [localhost] => {"changed": true, "msg": "Cask would be installed: dockertoolbox"} PLAY RECAP ******************************************************************** localhost : ok=3 changed=1 unreachable=0 failed=0 2017/1/27 Fukuoka.NET (Fukuten) #5 20
  6. playbook - hosts: windows tasks: - name: Install git win_chocolatey:

    name: git - name: Install SourceTree win_chocolatey: name: sourcetree - name: Install Notepad++ win_chocolatey: name: notepadplusplus.install 2017/1/27 Fukuoka.NET (Fukuten) #5 24