no more org in csv

This commit is contained in:
2023-03-31 16:46:18 +02:00
parent 2f330cf378
commit 884cbb2123
2 changed files with 5 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ bindpwd - from group variables
file : default account.csv csv file containing user to create: file : default account.csv csv file containing user to create:
```csv ```csv
org,firstname,lastname,email,[password] firstname,lastname,email,[password]
``` ```
password field optionnal - if empty will be generated automatically - WIP password field optionnal - if empty will be generated automatically - WIP
@@ -38,7 +38,7 @@ Including an example of how to use your role (for instance, with variables passe
user: tom user: tom
become: false become: false
roles: roles:
- { role: tco.new_ldap_user, file: ~/Documents/Opendoor/Clients/Plop/account.csv } - { role: tco.new_ldap_user, org=plop.fr,file: ~/Documents/Opendoor/Clients/Plop/account.csv }
License License
------- -------

View File

@@ -4,13 +4,14 @@
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 }}"
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 {{ item.firstname }}" - name: "add ldap account {{dn }}"
community.general.ldap_entry: community.general.ldap_entry:
bind_dn: "{{ binddn }}" bind_dn: "{{ binddn }}"
bind_pw: "{{ bindpwd }}" bind_pw: "{{ bindpwd }}"
dn: "uid={{ firstname |lower }}, ou={{ org }},{{ ldap_base }}" dn: "{{ dn }} "
state: present state: present
objectClass: objectClass:
- inetorgperson - inetorgperson