Users: define the uid accordito LDAP
This commit is contained in:
parent
1919f8dfec
commit
f642599504
@ -11,12 +11,20 @@
|
|||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
home: /home/{{ item.name }}
|
home: /home/{{ item.name }}
|
||||||
|
uid: "{{ item.uid }}"
|
||||||
shell: '{{ bash_path }}'
|
shell: '{{ bash_path }}'
|
||||||
groups: sudo
|
groups: sudo
|
||||||
append: true
|
append: true
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ user_details }}"
|
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
|
- name: All hosts | Set up home directory permissions for users
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /home/{{ item.name }}
|
path: /home/{{ item.name }}
|
||||||
@ -33,13 +41,6 @@
|
|||||||
mode: 0700
|
mode: 0700
|
||||||
with_items: "{{ user_details }}"
|
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
|
- name: Linux | Correct sudoers file permissions for ansible user
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "/etc/sudoers.d/ansible"
|
path: "/etc/sudoers.d/ansible"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
user_details:
|
user_details:
|
||||||
- { name: vincent }
|
- { name: vinishor, uid: 2000 }
|
||||||
- { name: mirsal }
|
- { name: mirsal, uid: 2001 }
|
||||||
- { name: jerome }
|
- { name: jerome, uid: 2002 }
|
||||||
- { name: sofian }
|
- { name: sofian, uid: 2003 }
|
||||||
|
- { name: epickiwi, uid: 2005 }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user