2021-02-20 11:19:17 +02: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 09:56:29 +02:00
|
|
|
set_fact:
|
2021-02-20 11:19:17 +02:00
|
|
|
admin_bool: 1
|
|
|
|
when: admin_access == 'true'
|
2021-03-16 09:56:29 +02:00
|
|
|
|
2021-02-20 11:19:17 +02:00
|
|
|
- name: Set boolean value to exit playbook
|
|
|
|
set_fact:
|
|
|
|
end_playbook: true
|
|
|
|
|
|
|
|
- name: Create user account
|
|
|
|
command: |
|
2021-02-28 16:21:40 +02:00
|
|
|
/usr/local/bin/matrix-synapse-register-user {{ new_username | quote }} {{ new_password | quote }} {{ admin_bool }}
|
2021-02-20 11:19:17 +02:00
|
|
|
register: cmd
|
|
|
|
|
|
|
|
- name: Result
|
|
|
|
debug: msg="{{ cmd.stdout }}"
|
2021-03-16 09:56:29 +02:00
|
|
|
|
2021-02-20 11:19:17 +02:00
|
|
|
- name: End playbook if this task list is called.
|
|
|
|
meta: end_play
|
|
|
|
when: end_playbook is defined and end_playbook|bool
|