From f64259950452a91dc69a4bedf386d061f21c098e Mon Sep 17 00:00:00 2001 From: Vincent Finance Date: Tue, 14 Jan 2025 21:30:56 +0100 Subject: [PATCH] Users: define the uid accordito LDAP --- ansible/roles/users/tasks/main.yml | 15 ++++++++------- ansible/roles/users/vars/debian.yml | 9 +++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ansible/roles/users/tasks/main.yml b/ansible/roles/users/tasks/main.yml index 5944aa0..e2af29d 100644 --- a/ansible/roles/users/tasks/main.yml +++ b/ansible/roles/users/tasks/main.yml @@ -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" diff --git a/ansible/roles/users/vars/debian.yml b/ansible/roles/users/vars/debian.yml index bfdd4d8..690851f 100644 --- a/ansible/roles/users/vars/debian.yml +++ b/ansible/roles/users/vars/debian.yml @@ -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 }