Pro Yearly is on sale from $80 to $50! »

AnsibleでVSCode拡張を管理しちゃおう!/why dont you manage vscode extension with Ansible?

AnsibleでVSCode拡張を管理しちゃおう!/why dont you manage vscode extension with Ansible?

E329c2e119f97cc394a4d494fc96edc4?s=128

あんでぃー

April 07, 2020
Tweet

Transcript

  1. AnsibleͰVSCode֦ுΛ ؅ཧͪ͠Ό͓͏ʂ VS Code Meetup #4 @20200407

  2. ࣗݾ঺հ • Πϯϑϥ԰͞Μ9೥໨ • ϓϩάϥϜ͋Μ·ॻ͔ͳ͍Ϛϯ • Ansible͖͢ ͋ΜͰ͌ʔ @answer_d

  3. ͖ͷ͏ͷग़དྷࣄ

  4. ಥવͷ DM

  5. ؒҧ͍ి࿩͔ʁ (ʁʁʁʁʁʁʁ)

  6. ↓ϫγͷconnpass

  7. None
  8. None
  9. None
  10. େมࣄ݅฽ (Ұൠ࿮ͩͱࢥͬͯͨɾɾɾ)

  11. ͱ͍͏Θ͚ͰLT͠·͢

  12. Ansibleͬͯͳʔʹʁ • ߏ੒؅ཧπʔϧ(OSS) • IaC(Infrastructure as Code) =ʮαʔόͷઃఆ؅ཧΛίʔυͰ΍ͬͪΌ͍·͠ΐ͏ʯͳϠπ • yamlΛϏϟοͱॻ͍࣮ͯߦ͢Δͱॻ͍ͨ௨Γʹઃఆ͞ΕΔ

  13. Ϗϟοʂʂʂʂʂ - name: ΠϯετʔϧࡁΈͷ֦ுػೳΛऔಘ command: code --list-extensions register: result_extension_list changed_when:

    false check_mode: false - name: ֦ுػೳͷΠϯετʔϧ command: "code --install-extension {{ item }}" loop: "{{ vscode_extensions | map('lower') | list }}" when: not item in (result_extension_list.stdout_lines | map('lower') | list) → VSCode֦ுΛΠϯετʔϧ͢ΔAnsibleͷίʔυ vscode_extensions: - MS-CEINTL.vscode-language-pack-ja - redhat.vscode-yaml - vscoss.vscode-ansible +͜Μͳײ͡Ͱ֦ுػೳΛϦετ
  14. - name: ΠϯετʔϧࡁΈͷ֦ுػೳΛऔಘ command: code --list-extensions register: result_extension_list changed_when: false

    check_mode: false - name: ֦ுػೳͷΠϯετʔϧ command: "code --install-extension {{ item }}" loop: "{{ vscode_extensions | map('lower') | list }}" when: not item in (result_extension_list.stdout_lines | map('lower') | list) codeίϚϯυͰ֦ுػೳͷ ϦετΛऔಘͯ͠ม਺ʹ֨ೲ vscode_extensions: - MS-CEINTL.vscode-language-pack-ja - redhat.vscode-yaml - vscoss.vscode-ansible
  15. - name: ΠϯετʔϧࡁΈͷ֦ுػೳΛऔಘ command: code --list-extensions register: result_extension_list changed_when: false

    check_mode: false - name: ֦ுػೳͷΠϯετʔϧ command: "code --install-extension {{ item }}" loop: "{{ vscode_extensions | map('lower') | list }}" when: not item in (result_extension_list.stdout_lines | map('lower') | list) ม਺͔Βϧʔϓ࣮ߦ ɹ→ ϧʔϓதɺ֤ཁૉ͸itemͱ͍͏໊લʹͳΔ ※ ֦ுػೳ໊͸େจࣈখจࣈΛ۠ผ͠ͳ͍ͨΊɺlower ϑΟϧλͰจࣈྻൺֱ͠΍ͯ͘͢͠Δ(͜͜޻෉) vscode_extensions: - MS-CEINTL.vscode-language-pack-ja - redhat.vscode-yaml - vscoss.vscode-ansible ͜͜Λίϐϖ
  16. - name: ΠϯετʔϧࡁΈͷ֦ுػೳΛऔಘ command: code --list-extensions register: result_extension_list changed_when: false

    check_mode: false - name: ֦ுػೳͷΠϯετʔϧ command: "code --install-extension {{ item }}" loop: "{{ vscode_extensions | map('lower') | list }}" when: not item in (result_extension_list.stdout_lines | map('lower') | list) ৚݅෼ذ: ֦ுػೳ͕Πϯετʔϧ͞Ε ͍ͯͳ͔ͬͨΒॲཧ࣮ߦ vscode_extensions: - MS-CEINTL.vscode-language-pack-ja - redhat.vscode-yaml - vscoss.vscode-ansible
  17. - name: ΠϯετʔϧࡁΈͷ֦ுػೳΛऔಘ command: code --list-extensions register: result_extension_list changed_when: false

    check_mode: false - name: ֦ுػೳͷΠϯετʔϧ command: "code --install-extension {{ item }}" loop: "{{ vscode_extensions | map('lower') | list }}" when: not item in (result_extension_list.stdout_lines | map('lower') | list) codeίϚϯυͰ֦ுػೳΛ Πϯετʔϧ vscode_extensions: - MS-CEINTL.vscode-language-pack-ja - redhat.vscode-yaml - vscoss.vscode-ansible
  18. ࣮ߦΠϝʔδ TASK [vscode : ΠϯετʔϧࡁΈͷ֦ுػೳΛऔಘ] ******************************* ok: [localhost] TASK [vscode

    : ֦ுػೳͷΠϯετʔϧ] *************************************** changed: [localhost] => (item=ms-ceintl.vscode-language-pack-ja) changed: [localhost] => (item=vscode-icons-team.vscode-icons) changed: [localhost] => (item=ms-python.python) changed: [localhost] => (item=redhat.vscode-yaml) changed: [localhost] => (item=vscoss.vscode-ansible) changed: [localhost] => (item=wraith13.background-phi-colors) changed: [localhost] => (item=wraith13.clairvoyant) changed: [localhost] => (item=wraith13.zoombar-vscode) changed: [localhost] => (item=oderwat.indent-rainbow) changed: [localhost] => (item=mechatroner.rainbow-csv) changed: [localhost] => (item=ms-azuretools.vscode-docker) changed: [localhost] => (item=davidanson.vscode-markdownlint) changed: [localhost] => (item=wholroyd.jinja) changed: [localhost] => (item=eamodio.gitlens) changed: [localhost] => (item=74th.monokai-charcoal-high-contrast) changed: [localhost] => (item=johnpapa.vscode-peacock) changed: [localhost] => (item=dracula-theme.theme-dracula) changed: [localhost] => (item=skyapps.fish-vscode) changed: [localhost] => (item=alefragnani.bookmarks) changed: [localhost] => (item=ms-kubernetes-tools.vscode-kubernetes-tools) changed: [localhost] => (item=ipedrazas.kubernetes-snippets) changed: [localhost] => (item=ms-vscode.go)
  19. ͏·Έ • ʮ͍ΖΜͳ؀ڥͰಉ֦͡ுػೳΛ࢖͍͍͚ͨͲɺSettings Sync͸࢖͑ͳ͍…ʯͦΜͳوํʹʂ • VSCode֦ுʹݶΒͣɺ৭ʑͳઃఆΛίʔυԽͰ͖·͢ʂ

  20. (঺հ) ԶͷMacbookΛߏங͢ΔAnsibleϓϨΠϒοΫ • VSCode֦ுͷ؅ཧҎ֎ʹ΋͜Μͳ͜ͱΛ·ͱΊͯ΍Γ·͢ - homebrew/caskͰύοέʔδ௥Ճ - OSઃఆ(OSX defaults) -

    ϗετ໊ઃఆ - fish+powerline؀ڥߏங - γΣϧͷΤΠϦΞεͱ͔Λઃఆ - VSCode settings.jsonઃఆ - gitconfigͱ͔vimrcͱ͔ઃఆ https://github.com/answer-d/mac_os_setup_playbook
  21. ·ͱΊ • AnsibleͰ֦ுػೳͱ͔Λ؅ཧ͢Δͷ͸͍͍ͧ • ͍ͭPC͕രൃͯ͠΋େৎ෉ → ѹ౗త҆৺ײ •Πϕϯτਃࠐɺ࿮ʹؾΛ͚ͭΑ͏ʂ

  22. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ ͋ΜͰ͌ʔ @answer_d