Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

44 righe
1.9 KiB

  1. ---
  2. - name: Record Element-Web variables locally on AWX
  3. delegate_to: 127.0.0.1
  4. lineinfile:
  5. path: '{{ awx_cached_matrix_vars }}'
  6. regexp: "^#? *{{ item.key | regex_escape() }}:"
  7. line: "{{ item.key }}: {{ item.value }}"
  8. insertafter: '# Element Settings Start'
  9. with_dict:
  10. 'matrix_server_fqn_element': "{{ awx_element_subdomain | trim }}.{{ matrix_domain }}"
  11. - name: Save new 'Configure Element Subdomain' survey.json to the AWX tower, template
  12. delegate_to: 127.0.0.1
  13. template:
  14. src: 'roles/matrix-awx/surveys/configure_element_subdomain.json.j2'
  15. dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_element_subdomain.json'
  16. - name: Copy new 'Configure Element Subdomain' survey.json to target machine
  17. copy:
  18. src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_element_subdomain.json'
  19. dest: '/matrix/awx/configure_element_subdomain.json'
  20. mode: '0660'
  21. - name: Recreate 'Configure Element Subdomain' job template
  22. delegate_to: 127.0.0.1
  23. awx.awx.tower_job_template:
  24. name: "{{ matrix_domain }} - 1 - Configure Element Subdomain"
  25. description: "Configure Element clients subdomain location. (Eg: 'element' for element.example.org)"
  26. extra_vars: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/extra_vars.json') }}"
  27. job_type: run
  28. job_tags: "start,setup-all,setup-client-element-subdomain"
  29. inventory: "{{ member_id }}"
  30. project: "{{ member_id }} - Matrix Docker Ansible Deploy"
  31. playbook: setup.yml
  32. credential: "{{ member_id }} - AWX SSH Key"
  33. survey_enabled: true
  34. survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_element_subdomain.json') }}"
  35. state: present
  36. verbosity: 1
  37. tower_host: "https://{{ awx_host }}"
  38. tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
  39. validate_certs: true