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

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

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/

innossh

December 21, 2017
Tweet

More Decks by innossh

Other Decks in Technology

Transcript

  1. - 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
  2. - 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
  3. - 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 }}"
  4. - name: Retry E2E partially include_tasks: e2e-partial.yml e2e_partial_parameter={{ item.1 }}

    with_nested: - "{{ e2e_partial_retry_numbers }}" - "{{ e2e_retry_tests }}"