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.
 
 

41 lines
1.2 KiB

  1. #
  2. # Create user and define if they are admin
  3. #
  4. # /usr/local/bin/matrix-synapse-register-user <your_username> <your_password> <admin access: 0 or 1>
  5. #
  6. - name: Set admin bool to zero
  7. set_fact:
  8. awx_admin_bool: 0
  9. when: awx_admin_access == 'false'
  10. - name: Examine if server admin set
  11. set_fact:
  12. awx_admin_bool: 1
  13. when: awx_admin_access == 'true'
  14. - name: Create user account
  15. command: |
  16. /usr/local/bin/matrix-synapse-register-user {{ awx_new_username | quote }} {{ awx_new_password | quote }} {{ awx_admin_bool }}
  17. register: awx_cmd_output
  18. - name: Delete the AWX session token for executing modules
  19. awx.awx.tower_token:
  20. description: 'AWX Session Token'
  21. scope: "write"
  22. state: absent
  23. existing_token_id: "{{ awx_session_token.ansible_facts.tower_token.id }}"
  24. tower_host: "https://{{ awx_host }}"
  25. tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
  26. - name: Set boolean value to exit playbook
  27. set_fact:
  28. awx_end_playbook: true
  29. - name: Result
  30. debug: msg="{{ awx_cmd_output.stdout }}"
  31. - name: End playbook if this task list is called.
  32. meta: end_play
  33. when: awx_end_playbook is defined and awx_end_playbook|bool