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.
 
 

45 lines
1.9 KiB

  1. ---
  2. - name: Record Synapse Admin 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: '# Synapse Admin Settings Start'
  9. with_dict:
  10. 'matrix_synapse_admin_enabled': '{{ matrix_synapse_admin_enabled }}'
  11. - name: Save new 'Configure Synapse Admin' survey.json to the AWX tower, template
  12. delegate_to: 127.0.0.1
  13. template:
  14. src: 'roles/matrix-awx/surveys/configure_synapse_admin.json.j2'
  15. dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_synapse_admin.json'
  16. - name: Copy new 'Configure Synapse Admin' survey.json to target machine
  17. copy:
  18. src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_synapse_admin.json'
  19. dest: '/matrix/awx/configure_synapse_admin.json'
  20. mode: '0660'
  21. - name: Recreate 'Configure Synapse Admin' job template
  22. delegate_to: 127.0.0.1
  23. awx.awx.tower_job_template:
  24. name: "{{ matrix_domain }} - 1 - Configure Synapse Admin"
  25. description: "Configure 'Synapse Admin', a moderation tool to help you manage your server."
  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"
  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_synapse_admin.json') }}"
  35. become_enabled: true
  36. state: present
  37. verbosity: 1
  38. tower_host: "https://{{ awx_host }}"
  39. tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
  40. validate_certs: true