admin-user: switch to a Dict for admin_users
This commit is contained in:
parent
0ff5467bce
commit
b49cd060eb
2 changed files with 9 additions and 6 deletions
|
@ -8,16 +8,18 @@ Everything is in the `tasks/main.yml` file.
|
|||
|
||||
## Available variables
|
||||
|
||||
The variable `admin_users` must be a "hash" of one or more users :
|
||||
The variable `admin_users` must be a "dict" of one or more users :
|
||||
|
||||
```
|
||||
admin_users:
|
||||
- name: foo
|
||||
foo:
|
||||
name: foo
|
||||
uid: 1001
|
||||
fullname: 'Mr Foo'
|
||||
password_hash: 'sdfgsdfgsdfgsdfg'
|
||||
ssh_key: 'ssh-rsa AZERTYXYZ'
|
||||
- name: bar
|
||||
bar:
|
||||
name: bar
|
||||
uid: 1002
|
||||
fullname: 'Mr Bar'
|
||||
password_hash: 'gsdfgsdfgsdfgsdf'
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
---
|
||||
|
||||
- include: adduser_debian.yml user={{ item }}
|
||||
with_items: "{{ admin_users }}"
|
||||
- include: adduser_debian.yml user={{ item.value }}
|
||||
with_dict: "{{ admin_users }}"
|
||||
when: ansible_distribution == "Debian"
|
||||
|
||||
# - include: openbsd.yml
|
||||
# - include: adduser_openbsd.yml user={{ item.value }}
|
||||
# with_dict: "{{ admin_users }}"
|
||||
# when: ansible_distribution == "OpenBSD"
|
||||
|
|
Loading…
Reference in a new issue