Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

103 wiersze
3.9 KiB

  1. - name: Record ma1sd 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: '# ma1sd Settings Start'
  8. with_dict:
  9. 'matrix_ma1sd_enabled': '{{ matrix_ma1sd_enabled }}'
  10. - name: Disable REST auth (matrix-corporal/ma1sd) if using internal auth
  11. delegate_to: 127.0.0.1
  12. lineinfile:
  13. path: '{{ awx_cached_matrix_vars }}'
  14. regexp: "^#? *{{ item.key | regex_escape() }}:"
  15. line: "{{ item.key }}: {{ item.value }}"
  16. insertafter: '# Synapse Extension Start'
  17. with_dict:
  18. 'matrix_synapse_ext_password_provider_rest_auth_enabled': 'false'
  19. when: ext_matrix_ma1sd_auth_store == 'Synapse Internal'
  20. - name: Enable REST auth if using external LDAP/AD with ma1sd
  21. delegate_to: 127.0.0.1
  22. lineinfile:
  23. path: '{{ awx_cached_matrix_vars }}'
  24. regexp: "^#? *{{ item.key | regex_escape() }}:"
  25. line: "{{ item.key }}: {{ item.value }}"
  26. insertafter: '# Synapse Extension Start'
  27. with_dict:
  28. 'matrix_synapse_ext_password_provider_rest_auth_enabled': 'true'
  29. 'matrix_synapse_ext_password_provider_rest_auth_endpoint': '"http://matrix-ma1sd:8090"'
  30. when: ext_matrix_ma1sd_auth_store == 'LDAP/AD'
  31. - name: Remove entire ma1sd configuration extension
  32. delegate_to: 127.0.0.1
  33. replace:
  34. path: '{{ awx_cached_matrix_vars }}'
  35. regexp: '^.*\n'
  36. after: '# Start ma1sd Extension'
  37. before: '# End ma1sd Extension'
  38. - name: Replace conjoined ma1sd configuration extension limiters
  39. delegate_to: 127.0.0.1
  40. replace:
  41. path: '{{ awx_cached_matrix_vars }}'
  42. regexp: '^# Start ma1sd Extension# End ma1sd Extension'
  43. replace: '# Start ma1sd Extension\n# End ma1sd Extension'
  44. - name: Insert/Update ma1sd configuration extension variables
  45. delegate_to: 127.0.0.1
  46. blockinfile:
  47. path: '{{ awx_cached_matrix_vars }}'
  48. marker: "# {mark} ma1sd ANSIBLE MANAGED BLOCK"
  49. insertafter: '# Start ma1sd Extension'
  50. block: '{{ ext_matrix_ma1sd_configuration_extension_yaml }}'
  51. - name: Record ma1sd Custom variables locally on AWX
  52. delegate_to: 127.0.0.1
  53. lineinfile:
  54. path: '{{ awx_cached_matrix_vars }}'
  55. regexp: "^#? *{{ item.key | regex_escape() }}:"
  56. line: "{{ item.key }}: {{ item.value }}"
  57. insertbefore: '# Custom Settings Start'
  58. with_dict:
  59. 'ext_matrix_ma1sd_auth_store': '{{ ext_matrix_ma1sd_auth_store }}'
  60. 'ext_matrix_ma1sd_configuration_extension_yaml': '{{ ext_matrix_ma1sd_configuration_extension_yaml.splitlines() | to_json }}'
  61. no_log: True
  62. - name: Save new 'Configure ma1sd' survey.json to the AWX tower, template
  63. delegate_to: 127.0.0.1
  64. template:
  65. src: 'roles/matrix-awx/surveys/configure_ma1sd.json.j2'
  66. dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_ma1sd.json'
  67. - name: Copy new 'Configure ma1sd' survey.json to target machine
  68. copy:
  69. src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_ma1sd.json'
  70. dest: '/matrix/awx/configure_ma1sd.json'
  71. mode: '0660'
  72. - name: Recreate 'Configure ma1sd (Advanced)' job template
  73. delegate_to: 127.0.0.1
  74. awx.awx.tower_job_template:
  75. name: "{{ matrix_domain }} - 1 - Configure ma1sd (Advanced)"
  76. description: "Configure Jitsi conferencing settings."
  77. extra_vars: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/extra_vars.json') }}"
  78. job_type: run
  79. job_tags: "start,setup-ma1sd"
  80. inventory: "{{ member_id }}"
  81. project: "{{ member_id }} - Matrix Docker Ansible Deploy"
  82. playbook: setup.yml
  83. credential: "{{ member_id }} - AWX SSH Key"
  84. survey_enabled: true
  85. survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_ma1sd.json') }}"
  86. become_enabled: yes
  87. state: present
  88. verbosity: 1
  89. tower_host: "https://{{ awx_host }}"
  90. tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
  91. validate_certs: yes