1
0
Fork 0
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:
L3D 2024-02-23 19:13:13 +01:00
parent 5012244a39
commit 0b554d4ab6
Signed by: l3d
GPG key ID: CD08445BFF4313D1
7 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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

View file

@ -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'

View file

@ -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"

View file

@ -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'