Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

52 строки
2.2 KiB

  1. - name: Record Jitsi 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: '# Jitsi Settings Start'
  8. with_dict:
  9. 'matrix_jitsi_enabled': '{{ matrix_jitsi_enabled }}'
  10. 'matrix_jitsi_web_config_defaultLanguage': '{{ matrix_jitsi_web_config_defaultLanguage }}'
  11. - name: Save new 'Configure Jitsi' survey.json to the AWX tower, template
  12. delegate_to: 127.0.0.1
  13. template:
  14. src: 'roles/matrix-awx/surveys/configure_jitsi.json.j2'
  15. dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json'
  16. - name: Copy new 'Configure Jitsi' survey.json to target machine
  17. copy:
  18. src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json'
  19. dest: '/matrix/awx/configure_jitsi.json'
  20. mode: '0660'
  21. - name: Collect AWX admin token the hard way!
  22. delegate_to: 127.0.0.1
  23. shell: |
  24. curl -sku {{ tower_username }}:{{ tower_password }} -H "Content-Type: application/json" -X POST -d '{"description":"Tower CLI", "application":null, "scope":"write"}' https://{{ tower_host }}/api/v2/users/1/personal_tokens/ | jq '.token' | sed -r 's/\"//g'
  25. register: tower_token
  26. no_log: True
  27. - name: Recreate 'Configure Jitsi' job template
  28. delegate_to: 127.0.0.1
  29. awx.awx.tower_job_template:
  30. name: "{{ matrix_domain }} - 1 - Configure Jitsi"
  31. description: "Configure Jitsi conferencing settings."
  32. extra_vars: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/extra_vars.json') }}"
  33. job_type: run
  34. job_tags: "start,setup-jitsi"
  35. inventory: "{{ member_id }}"
  36. project: "{{ member_id }} - Matrix Docker Ansible Deploy"
  37. playbook: setup.yml
  38. credential: "{{ member_id }} - AWX SSH Key"
  39. survey_enabled: true
  40. survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json') }}"
  41. become_enabled: yes
  42. state: present
  43. verbosity: 1
  44. tower_host: "https://{{ tower_host }}"
  45. tower_oauthtoken: "{{ tower_token.stdout }}"
  46. validate_certs: yes