mirror of
https://github.com/roles-ansible/ansible_collection_users.git
synced 2024-08-16 10:29:50 +02:00
Merge pull request #31 from roles-ansible/g
Create variable for additional groups
This commit is contained in:
commit
852a5e1ad1
5 changed files with 11 additions and 1 deletions
|
@ -92,6 +92,7 @@ There is also the ``l3d_users__ssh_login`` variable which only supports ``name``
|
|||
| ``l3d_users__ansible_user_command`` | ``ALL`` | Commans with superpower for ansible user |
|
||||
| ``l3d_users__ansible_user_nopassword`` | ``true`` | Allow superpowers without password for ansible user |
|
||||
| ``l3d_users__limit_login`` | ``true`` | Only allow SSH login for specified users |
|
||||
| ``l3d_users__additional_groups`` | ``[]`` | Optionally create some groups |
|
||||
| ``l3d_users__sshd_port`` | ``22`` | Port for SSH |
|
||||
| ``l3d_users__sshd_password_authentication`` | ``false`` | Allow login with Password |
|
||||
| ``l3d_users__sshd_permitrootlogin`` | ``false`` | Allow login as root |
|
||||
|
|
|
@ -46,6 +46,7 @@ The Option of these directory-variables are the following.
|
|||
| ``l3d_users__set_root_ssh_keys`` | ``false`` | Set SSH Keys for root User |
|
||||
| ``l3d_users__root_ssh_keys`` | | Additional SSH Keys for root User |
|
||||
| ``submodules_versioncheck`` | ``false`` | Optionaly enable simple versionscheck of this role |
|
||||
| ``l3d_users__additional_groups`` | ``[]`` | Optionally create some groups |
|
||||
|
||||
Example Playbook
|
||||
-----------------
|
||||
|
|
|
@ -37,6 +37,7 @@ l3d_users__ansible_ssh_keys: "{{ lookup('url', 'https://github.com/do1jlr.keys',
|
|||
l3d_users__ansible_user_password: ''
|
||||
l3d_users__set_root_ssh_keys: false
|
||||
l3d_users__root_ssh_keys: ''
|
||||
l3d_users__additional_groups: []
|
||||
|
||||
# run simple versionscheck
|
||||
submodules_versioncheck: false
|
||||
|
|
|
@ -10,6 +10,13 @@
|
|||
loop_var: user
|
||||
when: user.state | default ('present') == 'present'
|
||||
|
||||
- name: Optionally create additional Groups
|
||||
become: true
|
||||
ansible.builtin.group:
|
||||
name: "{{ item }}"
|
||||
state: 'present'
|
||||
with_items: "{{ l3d_users__additional_groups }}"
|
||||
|
||||
- name: Create Accounts for Users
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
playbook_version_number: 16
|
||||
playbook_version_number: 17
|
||||
playbook_version_path: 'l3d.users.user.version'
|
||||
|
|
Loading…
Reference in a new issue