new variable so we can chose attribute used for DN
This commit is contained in:
@@ -12,6 +12,7 @@ Role Variables
|
|||||||
--------------
|
--------------
|
||||||
org: no default
|
org: no default
|
||||||
ldap_base - from group variables
|
ldap_base - from group variables
|
||||||
|
nlu_dn_attribute - default firstname can be email
|
||||||
binddn - from group variables
|
binddn - from group variables
|
||||||
bindpwd - from group variables
|
bindpwd - from group variables
|
||||||
file : default account.csv csv file containing user to create:
|
file : default account.csv csv file containing user to create:
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
---
|
---
|
||||||
# defaults file for tco.new_ldap_user
|
# defaults file for tco.new_ldap_user
|
||||||
|
nlu_dn_attribute: "firstname"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
firstname: "{{ item.firstname }}"
|
firstname: "{{ item.firstname }}"
|
||||||
lastname: "{{ item.lastname }}"
|
lastname: "{{ item.lastname }}"
|
||||||
email: "{{ item.email }}"
|
email: "{{ item.email }}"
|
||||||
dn: "uid={{ item.firstname |lower }}, ou={{ org }},{{ ldap_base }}"
|
dn: "uid={{ item[ nlu_dn_attribute ] |lower }},ou={{ org }},{{ ldap_base }}"
|
||||||
password: "{{ (item.password=='')| ternary(lookup('community.general.random_string', min_lower=1, min_upper=1, special=false,min_numeric=1, length=14), item.password ) }}"
|
password: "{{ (item.password=='')| ternary(lookup('community.general.random_string', min_lower=1, min_upper=1, special=false,min_numeric=1, length=14), item.password ) }}"
|
||||||
|
|
||||||
- name: "add ldap account {{dn }}"
|
- name: "add ldap account {{dn }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user