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

AnsibleとAWXでレガシーな本番環境デプロイを1-Click実行 / LT - Ansible Night in Tokyo 201712

417e12007b6c4e45cfdb1cc2291ca019?s=47 innossh
December 21, 2017

AnsibleとAWXでレガシーな本番環境デプロイを1-Click実行 / LT - Ansible Night in Tokyo 201712

Ansible Night in Tokyo 2017.12
https://ansible-users.connpass.com/event/71613/

417e12007b6c4e45cfdb1cc2291ca019?s=128

innossh

December 21, 2017
Tweet

More Decks by innossh

Other Decks in Technology

Transcript

  1. $MJDL࣮ߦ ϨΨγʔͳຊ൪؀ڥσϓϩΠΛ

  2. ‣ !JOOPTTI ‣ ,JJ*P5Ϋϥ΢υϓϥοτϑΥʔϜ ‣ ιϑτ΢ΣΞΤϯδχΞ %FW0QT ࣗݾ঺հ

  3. ,JJ$MPVE͸ ೥͔ΒαʔϏε։࢝

  4. ϨΨγʔͱϞμϯ

  5. ϨΨγʔ Ϟμϯ &$ &$ &$ &$

  6. ೥୅෺ͷൿ఻ͷखॱॻ ͱ࡞ۀͷଐਓԽ

  7. ‣ Ϛωʔδϝϯτίϯιʔϧ͔Βϩʔυόϥϯ αʔ੾Γ཭͠௥Ճ ‣ ϗετʹ44)ϩάΠϯ ‣ QVQQFUͰࠩ෼֬ೝͱߋ৽ ‣ ࠩ෼݁ՌΛ4MBDLͳͲͰڞ༗ ‣

    &&ςετΛ+FOLJOTͰ࣮ߦ ‣ ʜ
  8. ͭΒ͍ʗ ?P? ʘ

  9. ࣗಈԽ͍ͨ͠

  10. "OTJCMFͱ"89Ͱ $MJDL࣮ߦ σϓϩΠ

  11. lϩʔυόϥϯα͔Β ͷ੾Γ཭͠ͷࣗಈԽ͸ʁ

  12. FMC@JOTUBODFϞδϡʔ ϧͰͰ͖ΔΑ XBJU@GPSϞδϡʔϧศར

  13. - name: Wait for instance port to close active connections

    wait_for: host: 0.0.0.0 port: "{{ instance_port }}" delay: 10 sleep: 10 # check every 10 seconds state: drained timeout: 300 exclude_hosts: 127.0.0.1
  14. l+FOLJOT্ͷ&& ςετ࣮ߦͷࣗಈԽ͸ʁ

  15. lҰ෦ͷ&&ςετ͕ࣦ ഊ͢Δ͜ͱ͕͋Δɻ ෦෼తʹϦτϥΠ͍ͨ͠

  16. UBTLͷSFUSZΦϓγϣϯɺ ͍΍CMPDLSFTDVFͰɺɺ Ͱ͖ͳ͍ͳʜ͙͵͵

  17. JODMVEF@UBTLTʹม਺Λ ౉ͯ͠ϧʔϓͤ͞Α͏

  18. - name: Get E2E test report uri: url: "{{ e2e_job_url

    }}/ {{ e2e_result_build_number }}/testReport/api/ json" method: GET user: "{{ e2e_jenkins_user }}" password: "{{ e2e_jenkins_api_token }}" force_basic_auth: yes status_code: - 200 register: e2e_test_report
  19. - set_fact: e2e_failed_tests: "{{ e2e_test_report.json | json_query(failed_tests_query) }}" vars: failed_tests_query:

    "suites[*].cases[? status=='REGRESSION'||status=='FAILED'].className" - set_fact: e2e_retry_tests: "{{ e2e_retry_tests | default([]) + [item] }}" with_flattened: - "{{ e2e_failed_tests }}" - set_fact: e2e_partial_retry_numbers: "{{ e2e_partial_retry_numbers | default([]) + [ item ] }}" with_sequence: count="{{ e2e_partial_retry_count | int }}"
  20. - name: Retry E2E partially include_tasks: e2e-partial.yml e2e_partial_parameter={{ item.1 }}

    with_nested: - "{{ e2e_partial_retry_numbers }}" - "{{ e2e_retry_tests }}"
  21. ϨΨγʔͳσϓϩΠͷ QMBZCPPLԽ͸ น͕ଟ͍͚ΕͲ

  22. "OTJCMFͳΒ ෳࡶͳॲཧͰ΋ :".-Ͱγϯϓϧʹ

  23. QMBZCPPL࡞ͬͨΒ "89Λ༻ҙ͢Δ͚ͩ

  24. None
  25. ߦ௒͑ʂ

  26. σϓϩΠ݁Ռ͕ϒϥ΢βͰ ֬ೝͰ͖ͯڞ༗͠΍͍͢

  27. ϨΨγʔ؀ڥͷσϓϩ ΠΛࣗಈԽͨ݁͠Ռ

  28. ଐਓԽ͠ͳ͍σϓϩΠ ͕Մೳʹ

  29. ޾ͤʁ

  30. ‣ ෳࡶͳ࡞ۀͷࣗಈԽͰ΋"OTJCMFͳΒ :".-Ͱॻ͚ͯγϯϓϧ ‣ ༷ʑͳQMBZCPPL࣮ߦΛ"89Ͱதԝू ݖԽ ‣ ϨΨγʔ؀ڥ΋"OTJCMFͱ"89Ͱଐਓ Խͷഉআɺ$MJDLσϓϩΠ ·ͱΊ

    ΤϯδχΞืू͍ͯ͠·͢ʂIUUQTKQLJJDPNSFDSVJU