Adding group management to users

This commit is contained in:
Tyler Hale 2025-02-02 21:31:46 -07:00
parent c83cad2e88
commit 5a88ccb426
Signed by: Tyler
GPG key ID: C7CC4B910D88EF96
3 changed files with 10 additions and 1 deletions

View file

@ -42,4 +42,4 @@ Available tags for the role:
| Role | Tags |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Base | all, authorized_key, automatic_updates, cert, firewall, hostname, kernel, motd, password_auth, root_ca, root_login, ssh, time_sync, web_management |
| Base | all, authorized_key, automatic_updates, cert, firewall, hostname, kernel, motd, password_auth, root_ca, root_login, ssh, time_sync, users, web_management |

View file

@ -15,6 +15,8 @@ base_users: []
# disable_password: false
# ssh_keys: []
# ssh_keys_force: false # setting ssh_keys_force to true will overwrite the authorized_keys file to only be the ssh keys provided
# groups: []
# groups_append: true
# Install all available updates at runtime
base_core_install_updates: true

View file

@ -6,6 +6,13 @@
name: "{{ user.username }}"
password_lock: "{{ user.disable_password | default(false) }}"
- name: "{{ user.username }} group setup"
user:
name: "{{ user.username }}"
groups: "{{ user.groups | join(',') }}"
append: "{{ user.groups_append | default('true') }}"
when: user.groups is defined
- name: "Configure {{ user.username }} password"
user:
name: "{{ user.username }}"