mirror of
https://github.com/roles-ansible/ansible_collection_users.git
synced 2024-08-16 10:29:50 +02:00
Add ability to add additional groups
This commit is contained in:
parent
5012244a39
commit
0b554d4ab6
7 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,7 @@ The Option of these directory-variables are the following.
|
||||||
| ``pubkeys`` | string or lookup | - | see examples |
|
| ``pubkeys`` | string or lookup | - | see examples |
|
||||||
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
||||||
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
||||||
|
| ``groups`` | list | - | Additional groups for your user |
|
||||||
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
||||||
|
|
||||||
### Other variables
|
### Other variables
|
||||||
|
|
|
@ -29,6 +29,7 @@ The Option of these directory-variables are the following.
|
||||||
| ``pubkeys`` | string or lookup | - | see examples |
|
| ``pubkeys`` | string or lookup | - | see examples |
|
||||||
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
||||||
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
||||||
|
| ``groups`` | list | - | Additional groups for your user |
|
||||||
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
|
|
@ -27,6 +27,7 @@ The Option of these directory-variables are the following.
|
||||||
| ``pubkeys`` | string or lookup | - | see examples |
|
| ``pubkeys`` | string or lookup | - | see examples |
|
||||||
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
||||||
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
||||||
|
| ``groups`` | list | - | Additional groups for your user |
|
||||||
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
||||||
|
|
||||||
There is a third directory-variable called ``l3d_users__ssh_login: []`` which only support ``name`` and ``state`` for users, that sould be able to login on that system.
|
There is a third directory-variable called ``l3d_users__ssh_login: []`` which only support ``name`` and ``state`` for users, that sould be able to login on that system.
|
||||||
|
|
|
@ -28,6 +28,7 @@ The Option of these directory-variables are the following.
|
||||||
| ``pubkeys`` | string or lookup | - | see examples |
|
| ``pubkeys`` | string or lookup | - | see examples |
|
||||||
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
| ``exklusive_pubkeys`` | ``true`` | - | delete all undefined ssh keys |
|
||||||
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
| ``password`` | password hash | - | See [official FAQ](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) |
|
||||||
|
| ``groups`` | list | - | Additional groups for your user |
|
||||||
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
| ``remove`` | ``false`` | - | completly remove user if ``state: absent`` |
|
||||||
|
|
||||||
### Other Variables
|
### Other Variables
|
||||||
|
|
|
@ -15,6 +15,7 @@ l3d_users__default_users: []
|
||||||
# admin_commands: 'ALL'
|
# admin_commands: 'ALL'
|
||||||
# admin_nopassword: false
|
# admin_nopassword: false
|
||||||
# admin_ansible_login: true
|
# admin_ansible_login: true
|
||||||
|
# groups: ['admin', 'foo', 'bar']
|
||||||
# - name: 'bob'
|
# - name: 'bob'
|
||||||
# state: 'present'
|
# state: 'present'
|
||||||
# shell: '/bin/zsh'
|
# shell: '/bin/zsh'
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ user.name }}"
|
name: "{{ user.name }}"
|
||||||
group: "{{ user.name }}"
|
group: "{{ user.name }}"
|
||||||
|
groups: "{{ user.groups | default() }}"
|
||||||
state: 'present'
|
state: 'present'
|
||||||
create_home: "{{ user.create_home | default(true) }}"
|
create_home: "{{ user.create_home | default(true) }}"
|
||||||
comment: "User created by ansible"
|
comment: "User created by ansible"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
---
|
---
|
||||||
playbook_version_number: 8
|
playbook_version_number: 9
|
||||||
playbook_version_path: 'l3d.users.user.version'
|
playbook_version_path: 'l3d.users.user.version'
|
||||||
|
|
Loading…
Reference in a new issue