2021-02-20 10:19:17 +01:00
|
|
|
#
|
|
|
|
# Create user and define if they are admin
|
|
|
|
#
|
|
|
|
# /usr/local/bin/matrix-synapse-register-user <your_username> <your_password> <admin access: 0 or 1>
|
|
|
|
#
|
|
|
|
|
|
|
|
- name: Set admin bool to zero
|
|
|
|
set_fact:
|
|
|
|
admin_bool: 0
|
|
|
|
when: admin_access == 'false'
|
|
|
|
|
|
|
|
- name: Examine if server admin set
|
2021-03-16 14:52:26 +01:00
|
|
|
set_fact:
|
2021-02-20 10:19:17 +01:00
|
|
|
admin_bool: 1
|
|
|
|
when: admin_access == 'true'
|
2021-03-16 14:52:26 +01:00
|
|
|
|
2021-02-20 10:19:17 +01:00
|
|
|
- name: Set boolean value to exit playbook
|
|
|
|
set_fact:
|
|
|
|
end_playbook: true
|
|
|
|
|
|
|
|
- name: Create user account
|
|
|
|
command: |
|
2021-02-28 15:21:40 +01:00
|
|
|
/usr/local/bin/matrix-synapse-register-user {{ new_username | quote }} {{ new_password | quote }} {{ admin_bool }}
|
2021-02-20 10:19:17 +01:00
|
|
|
register: cmd
|
|
|
|
|
|
|
|
- name: Result
|
|
|
|
debug: msg="{{ cmd.stdout }}"
|
2021-03-16 14:52:26 +01:00
|
|
|
|
2021-02-20 10:19:17 +01:00
|
|
|
- name: End playbook if this task list is called.
|
|
|
|
meta: end_play
|
|
|
|
when: end_playbook is defined and end_playbook|bool
|