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

MacをAnsibleで
構成管理しちゃったお話

 MacをAnsibleで
構成管理しちゃったお話

5059d3f370ad7e1f4d8de4be79ae1a2c?s=128

adachin0817

July 30, 2019
Tweet

Transcript

  1. 2019/07/30 Ansible Night in Tokyo 2019.07 MacΛAnsibleͰ
 ߏ੒؅ཧͪ͠Ό͓ͬͨ࿩ Lancers,Inc
 @adachin0817/SRE

  2. 2019/07/30 Ansible Night in Tokyo 2019.07 ΞδΣϯμ  ɾࣗݾ঺հ ɾݸਓతͳ͓࿩

    ɾansible_MacΛ࡞ͬͨΘ͚ ɾߏ੒ ɾ࢖͍ํ ɾσϞ ɾ·ͱΊ
  3. 2019/07/30 Ansible Night in Tokyo 2019.07 ࣗݾ঺հ

  4. 2019/07/30 Ansible Night in Tokyo 2019.07 ࣗݾ঺հ  - name:

    Introduction me user: name: adachi.ryo(adachin) work: SRE detail: aws analytical base
 skill: ansible terraform embulk shell PHP go
 blog: blog.adachin.me
 oss: Vuls contributor Evangelist twitter:adachin0817 github:RVIRUS0817 
  5. 2019/07/30 Ansible Night in Tokyo 2019.07 ݸਓతͳ͓࿩

  6. 2019/07/30 Ansible Night in Tokyo 2019.07  ݸਓϒϩάΛDigitalOceanʹҠߦ  https://blog.adachin.me/archives/10635

    γϯΨϙʔϧϦʔδϣϯ ʹͳΓ·ͨ͠✌ ౦ژϦʔδϣϯ͔Β
  7. 2019/07/30 Ansible Night in Tokyo 2019.07  ϥϯαʔζΛࢧ͑Δٕज़ 

  8. 2019/07/30 Ansible Night in Tokyo 2019.07 ansible_MacΛ࡞ͬͨΘ͚

  9. 2019/07/30 Ansible Night in Tokyo 2019.07 Θ͍ͷλʔϛφϧ؀ڥͱΞϓϦέʔγϣϯΒ  ɾnvim/dein.vim ɾzsh

    ɾtmux/powerline ɾpeco/ghq (control + h(history),j(ssh)/repo
 ɾ伴͸Google DriveͳͲͰ؅ཧ
  10. 2019/07/30 Ansible Night in Tokyo 2019.07 օ͞Μ͜Μͳܦݧ͋Γ·ͤΜ͔ʁ  ɾࠓ·Ͱ͸gistΛ࢖ͬͯ؅ཧ(Θ͔Δ) ɾίϐϖͰରԠ(μα͍✌)

    ɾԿΛมߋͨ͠ͷ͔๨ΕͯݸਓͷPCͱ૬ҧ͕ग़Δ(ന໨)
 ɾస৬ͨ͠ͱ͖(ങ͍ସ͑)ʹηοτΞοϓ͕μϧ͍ ɾ͍ͭ΋ೖΕͯΔΞϓϦέʔγϣϯͳΜ͚ͩͬ ɾ؂ࠪͳͲͰTime machine͕࢖͑ͳ͍ ɾTime machineͰ΋͍͍͕ແବͳ΋ͷ͸ೖΕͨ͘ͳ͍
  11. 2019/07/30 Ansible Night in Tokyo 2019.07 ͦͯ͠AnsibleͰ࡞ͬͯ͠·ͬͨ  ɾ2017೥ ɾAnsible

    2.8.3 ɾ׬શϦϙδτϦԽ ɾϗʔϜσΟϨΫτϦʹ͋ΔઃఆϑΝΠϧΛ؅ཧ ɾChromeͳͲͷΞϓϦέʔγϣϯ΋؅ཧ ɾhomebrewͷύοέʔδ΋؅ཧ ɾ؆୯ʹΧελϚΠζͰ͖ΔΑ͏ʹ https://blog.adachin.me/archives/5040
 https://github.com/RVIRUS0817/ansible_Mac ansible_Mac
  12. 2019/07/30 Ansible Night in Tokyo 2019.07 ߏ੒

  13. 2019/07/30 Ansible Night in Tokyo 2019.07 ߏ੒  ɾroles͸3ͭ ɾϩʔΧϧϗετͰ࣮ߦ

    ɾgroup_vars/allʹͯύοέʔδ໊Λ؅ཧ
  14. 2019/07/30 Ansible Night in Tokyo 2019.07 ./scripts/first.sh  ɾ·ͣ͸HomebrewͱAnsibleΛΠϯετʔϧ

  15. 2019/07/30 Ansible Night in Tokyo 2019.07 roles/homebrew/tasks/main.yml 

  16. 2019/07/30 Ansible Night in Tokyo 2019.07 roles/homebrew-cask/tasks/main.yml 

  17. 2019/07/30 Ansible Night in Tokyo 2019.07 roles/homedirectory/tasks/main.yml 

  18. 2019/07/30 Ansible Night in Tokyo 2019.07 group_vars/all  group_vars/allΛݟΕ͹Կ͕ೖ͍ͬͯΔ͔Θ͔Δʂ

  19. 2019/07/30 Ansible Night in Tokyo 2019.07 ࢖͍ํ

  20. 2019/07/30 Ansible Night in Tokyo 2019.07 ४උ  $ Fork!!!!!!!!!!!!!!!!!!!!!!!!!

    $ cd ansible_Mac $ ./scripts/first.sh 1. run first.sh 2. add role/homedirectory/files 3. add group_vars/all 4. dry-run $ ansible-playbook -i hosts mac.yml -KD -C 5. run $ ansible-playbook -i hosts mac.yml -KD 6. reboot Mac →ॳΊ࣮ͯߦ͢Δ৔߹
  21. 2019/07/30 Ansible Night in Tokyo 2019.07 group_vars/all 

  22. 2019/07/30 Ansible Night in Tokyo 2019.07 σϞ΍Γ·;

  23. 2019/07/30 Ansible Night in Tokyo 2019.07 ·ͱΊ

  24. 2019/07/30 Ansible Night in Tokyo 2019.07 ·ͱΊ  ɾγϯϓϧʹ࡞Εͨ
 ɾMacͷઃఆ౳ՄࢹԽͰ͖ͨ

    ɾΤϯδχΞಉ࢜ͰಠࣗίϚϯυ౳ڞ༗Ͱ͖ΔΑ͏ʹ ɾ৔ॴʹͱΒΘΕͣgit pullɺansible࣮ߦ͢Δ͚ͩ ɾ࣮ߦ͢Δͷʹ͕͔͔࣌ؒͬͯ͠·͏ ɾͥͻStarΛʂʂʂʂ
  25. 2019/07/30 Ansible Night in Tokyo 2019.07 ͝ਗ਼ௌ
 ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ