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.
 
 

53 wiersze
1.7 KiB

  1. ---
  2. - name: Fail if playbook called incorrectly
  3. ansible.builtin.fail:
  4. msg: "The `one_time` variable needs to be provided to this playbook, via --extra-vars"
  5. when: "one_time is not defined or one_time not in ['yes', 'no']"
  6. - name: Fail if playbook called incorrectly
  7. ansible.builtin.fail:
  8. msg: "The `ex_date` variable (expiration date) needs to be provided to this playbook, via --extra-vars"
  9. when: "ex_date is not defined or ex_date == '<date>'"
  10. - name: Call matrix-registration token creation API
  11. ansible.builtin.uri:
  12. url: "{{ matrix_registration_api_token_endpoint }}"
  13. follow_redirects: none
  14. validate_certs: "{{ matrix_registration_api_validate_certs }}"
  15. headers:
  16. Content-Type: application/json
  17. Authorization: "SharedSecret {{ matrix_registration_admin_secret }}"
  18. method: POST
  19. body_format: json
  20. body: |
  21. {
  22. "one_time": {{ 'true' if one_time == 'yes' else 'false' }},
  23. "ex_date": {{ ex_date | to_json }}
  24. }
  25. check_mode: false
  26. register: matrix_registration_api_result
  27. - ansible.builtin.set_fact:
  28. matrix_registration_api_result_message: >-
  29. matrix-registration result:
  30. Direct registration link (with the token prefilled):
  31. {{ matrix_registration_api_register_endpoint }}?token={{ matrix_registration_api_result.json.name }}
  32. Full token details are:
  33. {{ matrix_registration_api_result.json }}
  34. check_mode: false
  35. - name: Inject result message into devture_playbook_runtime_messages_list
  36. ansible.builtin.set_fact:
  37. devture_playbook_runtime_messages_list: |
  38. {{
  39. devture_playbook_runtime_messages_list | default([])
  40. +
  41. [matrix_registration_api_result_message]
  42. }}
  43. check_mode: false