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.

users.yml 658B

7 vuotta sitten
12345678910111213141516171819202122232425
  1. ---
  2. - name: primary group
  3. group:
  4. name: "{{ item }}"
  5. gid: "{{ users[item].gid }}"
  6. with_items: "{{ users.keys() }}"
  7. when: users[item].gid is defined
  8. - name: account
  9. user:
  10. name: "{{ item }}"
  11. group: "{{ item }}"
  12. groups: "{{ users[item].groups | default([]) | join(',') }}"
  13. uid: "{{ users[item].uid }}"
  14. home: "{{ users[item].home | default('/home/'+item) }}"
  15. shell: "{{ users[item].shell | default('/usr/bin/fish') }}"
  16. with_items: "{{ users.keys() }}"
  17. - name: password
  18. user:
  19. name: "{{ item }}"
  20. password: "{{ users[item].password }}"
  21. with_items: "{{ users.keys() }}"
  22. when: users[item].password is defined