Init openldap data
This commit is contained in:
22
ansible/roles/openldap_directory/tasks/users.yaml
Normal file
22
ansible/roles/openldap_directory/tasks/users.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
- name: Ensure users exist
|
||||
community.general.ldap_entry:
|
||||
dn: "uid={{ item.uid }},{{ ldap_people_ou }}"
|
||||
state: present
|
||||
objectClass:
|
||||
- inetOrgPerson
|
||||
- posixAccount
|
||||
- ldapPublicKey
|
||||
attributes:
|
||||
cn: "{{ item.cn }}"
|
||||
sn: "{{ item.sn }}"
|
||||
uid: "{{ item.uid }}"
|
||||
uidNumber: "{{ item.uidNumber }}"
|
||||
gidNumber: "{{ item.gidNumber }}"
|
||||
homeDirectory: "/home/{{ item.uid }}"
|
||||
loginShell: /bin/bash
|
||||
loop: "{{ ldap_users }}"
|
||||
args:
|
||||
server_uri: "{{ ldap_uri }}"
|
||||
bind_dn: "{{ ldap_admin_dn }}"
|
||||
bind_pw: "{{ ldap_admin_pw }}"
|
||||
start_tls: yes
|
||||
Reference in New Issue
Block a user