b76b876750
refactor: changed variables pattern to be more consistent with ansible good practises and more flexible to use. refactor: remove useless comment doc: Readme in English and French
18 lines
582 B
YAML
18 lines
582 B
YAML
---
|
|
- name: List users
|
|
ansible.builtin.shell: yunohost user list --output-as json
|
|
register: ynh_registered_users_raw
|
|
changed_when: False
|
|
|
|
- name: Format json of users
|
|
ansible.builtin.set_fact: ynh_registered_users="{{ ynh_registered_users_raw.stdout | from_json }}"
|
|
|
|
- name: Create missing Yunohost users
|
|
ansible.builtin.shell: |
|
|
yunohost user create {{ item.name }} \
|
|
-f {{ item.firstname }} \
|
|
-l {{ item.lastname }} \
|
|
-d {{ item.mail_domain }} \
|
|
-p {{ item.pass }}
|
|
loop: "{{ ynh_users }}"
|
|
when: item.name not in ynh_registered_users.users.keys()
|