Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
1.9 KiB

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