Matrix Docker Ansible eploy
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

58 lines
2.4 KiB

  1. - name: Record Jitsi variables locally on AWX
  2. delegate_to: 127.0.0.1
  3. lineinfile:
  4. path: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml'
  5. regexp: "^#? *{{ item.key | regex_escape() }}:"
  6. line: "{{ item.key }}: {{ item.value }}"
  7. insertafter: '# Jitsi Settings'
  8. with_dict:
  9. 'matrix_jitsi_enabled': '{{ matrix_jitsi_enabled }}'
  10. 'matrix_jitsi_web_config_defaultLanguage': '{{ matrix_jitsi_web_config_defaultLanguage }}'
  11. - name: Copy new 'matrix_vars.yml' to target machine
  12. copy:
  13. src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml'
  14. dest: '/matrix/awx/matrix_vars.yml'
  15. mode: '0660'
  16. - name: Save new 'Configure Jitsi' survey.json to the AWX tower, template
  17. delegate_to: 127.0.0.1
  18. template:
  19. src: 'roles/matrix-awx/surveys/configure_jitsi.json.j2'
  20. dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json'
  21. - name: Copy new 'Configure Jitsi' survey.json to target machine
  22. copy:
  23. src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json'
  24. dest: '/matrix/awx/configure_jitsi.json'
  25. mode: '0660'
  26. - name: Collect AWX admin token the hard way!
  27. delegate_to: 127.0.0.1
  28. shell: |
  29. 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'
  30. register: tower_token
  31. no_log: True
  32. - name: Recreate 'Configure Jitsi' job template
  33. delegate_to: 127.0.0.1
  34. awx.awx.tower_job_template:
  35. name: "{{ matrix_domain }} - 1 - Configure Jitsi"
  36. description: "Configure Jitsi conferencing settings."
  37. extra_vars: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/extra_vars.json') }}"
  38. job_type: run
  39. job_tags: "start,setup-jitsi"
  40. inventory: "{{ member_id }}"
  41. project: "{{ member_id }} - Matrix Docker Ansible Deploy"
  42. playbook: setup.yml
  43. credential: "{{ member_id }} - AWX SSH Key"
  44. survey_enabled: true
  45. survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_jitsi.json') }}"
  46. become_enabled: yes
  47. state: present
  48. verbosity: 1
  49. tower_host: "https://{{ tower_host }}"
  50. tower_oauthtoken: "{{ tower_token.stdout }}"
  51. validate_certs: yes