Users: define the uid accordito LDAP

This commit is contained in:
Vincent F. 2025-01-14 21:30:56 +01:00
parent 1919f8dfec
commit f642599504
2 changed files with 13 additions and 11 deletions

View File

@ -11,12 +11,20 @@
ansible.builtin.user:
name: "{{ item.name }}"
home: /home/{{ item.name }}
uid: "{{ item.uid }}"
shell: '{{ bash_path }}'
groups: sudo
append: true
state: present
with_items: "{{ user_details }}"
- name: All hosts | Create the groups
ansible.builtin.group:
name: "{{ item.name }}"
gid: "{{ item.uid }}"
state: present
with_items: "{{ user_details }}"
- name: All hosts | Set up home directory permissions for users
ansible.builtin.file:
path: /home/{{ item.name }}
@ -33,13 +41,6 @@
mode: 0700
with_items: "{{ user_details }}"
#- name: All hosts | Add ssh keys for allowing connections
# ansible.builtin.template:
# src: authorized_keys
# dest: /home/vinishor/.ssh/authorized_keys
# owner: vinishor
# mode: 0600
- name: Linux | Correct sudoers file permissions for ansible user
ansible.builtin.file:
path: "/etc/sudoers.d/ansible"

View File

@ -1,7 +1,8 @@
---
user_details:
- { name: vincent }
- { name: mirsal }
- { name: jerome }
- { name: sofian }
- { name: vinishor, uid: 2000 }
- { name: mirsal, uid: 2001 }
- { name: jerome, uid: 2002 }
- { name: sofian, uid: 2003 }
- { name: epickiwi, uid: 2005 }