Missing groups tasks
This commit is contained in:
@@ -21,3 +21,9 @@ ldap_users:
|
|||||||
ssh_keys:
|
ssh_keys:
|
||||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHQyLuuN1SYM3ise8983bA7tT5VJqAI5CpPV1whEA9VF
|
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHQyLuuN1SYM3ise8983bA7tT5VJqAI5CpPV1whEA9VF
|
||||||
|
|
||||||
|
ldap_groups:
|
||||||
|
- name: jonathan
|
||||||
|
gid: 10001
|
||||||
|
members:
|
||||||
|
- jonathan
|
||||||
|
|
||||||
|
|||||||
15
ansible/roles/openldap_directory/tasks/groups.yaml
Normal file
15
ansible/roles/openldap_directory/tasks/groups.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
- name: Ensure LDAP groups exist
|
||||||
|
community.general.ldap_entry:
|
||||||
|
dn: "cn={{ item.name }},ou=Groups,{{ ldap_basedn }}"
|
||||||
|
state: present
|
||||||
|
objectClass:
|
||||||
|
- posixGroup
|
||||||
|
attributes:
|
||||||
|
cn: "{{ item.name }}"
|
||||||
|
gidNumber: "{{ item.gid }}"
|
||||||
|
loop: "{{ ldap_groups }}"
|
||||||
|
args:
|
||||||
|
server_uri: "{{ ldap_uri }}"
|
||||||
|
bind_dn: "{{ ldap_directory_bind_dn }}"
|
||||||
|
bind_pw: "{{ ldap_directory_bind_pw }}"
|
||||||
|
start_tls: yes
|
||||||
Reference in New Issue
Block a user