Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
users.yml 549 B
Newer Older
sylvainar's avatar
sylvainar committed
---
- name: List users
  shell: yunohost user list --output-as json
  register: yunohost_registered_users_raw
  changed_when: False

- name: Format json of users
  set_fact: yunohost_registered_users="{{ yunohost_registered_users_raw.stdout | from_json }}"

- name: Create missing users
  shell: |
    yunohost user create {{ item.name }} \
sylvainar's avatar
sylvainar committed
    -f {{ item.firstname }} \
    -l {{ item.lastname }} \
    -m {{ item.mail }} \
    -p {{ item.pass }}
  with_items: "{{ yunohost.users }}"
  when: item.name not in yunohost_registered_users.users.keys()