Files
ansible_new_ldap_user/tasks/ldap_user_inc.yml

34 lines
1005 B
YAML

---
- name: add ldap ou
community.general.ldap_entry:
dn: "ou={{ org }},{{ ldap_base }}"
bind_dn: "{{ binddn }}"
bind_pw: "{{ bindpwd }}"
objectClass:
- organizationalUnit
- top
- name: add ldap account
vars:
firstname: "{{ item.firstname }}"
lastname: "{{ item.lastname }}"
email: "{{ item.email }}"
password: "{{ item.password }}"
community.general.ldap_entry:
bind_dn: "{{ binddn }}"
bind_pw: "{{ bindpwd }}"
dn: "uid={{ firstname |lower }}, ou={{ org }},{{ ldap_base }}"
state: present
objectClass:
- inetorgperson
- inetLocalMailRecipient
attributes:
givenName: "{{ firstname }}"
sn: "{{ lastname | default( firstname ) }}"
cn: "{{ firstname }}"
mail: "{{ email }}"
uid: "{{ firstname | lower }}"
PreferredDeliveryMethod: any
displayName: "{{ firstname }} {{ lastname }}"
userPassword: "{{ password }}"