org not needed in account.csv
create tmp password recap file upon account creation
This commit is contained in:
15
README.md
15
README.md
@@ -17,10 +17,10 @@ bindpwd - from group variables
|
||||
file : default account.csv csv file containing user to create:
|
||||
|
||||
```csv
|
||||
org,firstname,lastname,email,[password]
|
||||
firstname,lastname,email,[password]
|
||||
```
|
||||
|
||||
password field optionnal - if empty will be generated automatically
|
||||
password field optionnal - if empty will be generated automatically - WIP
|
||||
|
||||
keep the final comma, though !
|
||||
|
||||
@@ -34,20 +34,11 @@ Example Playbook
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
```bash
|
||||
cat <<EOF> account.csv
|
||||
org,firstname,lastname,email,password
|
||||
plop,thom,foobar,thom@plope.fr,
|
||||
EOF
|
||||
```
|
||||
|
||||
- hosts: collidine
|
||||
user: tom
|
||||
become: false
|
||||
roles:
|
||||
- role: tco.new_ldap_user,
|
||||
org: plop.fr
|
||||
file: ~/Document/Opendoor/Clients/Plop/account.csv
|
||||
- { role: tco.new_ldap_user, org=plop.fr,file: ~/Documents/Opendoor/Clients/Plop/account.csv }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
org,firstname,lastname,email,password
|
||||
plop,thom,foobar,thom@plope.fr,
|
||||
|
9
nlu.yml
9
nlu.yml
@@ -1,9 +0,0 @@
|
||||
---
|
||||
- hosts: collidine
|
||||
user: tom
|
||||
become: false
|
||||
roles:
|
||||
- role: tco.new_ldap_user
|
||||
org: plop.fr
|
||||
file: account.csv
|
||||
|
||||
@@ -27,7 +27,12 @@
|
||||
userPassword: "{{ password }}"
|
||||
register: result
|
||||
|
||||
- name: display
|
||||
debug:
|
||||
msg: "{{ firstname }} created with password >{{ password }}<"
|
||||
- name: "account recap"
|
||||
ansible.builtin.lineinfile:
|
||||
path: "tmppassword.csv"
|
||||
state: present
|
||||
create: true
|
||||
line: "{{ firstname | lower }},{{ password }}"
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
when: result.changed
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
tags: always
|
||||
when: binddn is not defined
|
||||
|
||||
- name: add ldap ou
|
||||
- name: "add ldap ou ou={{ org }},{{ ldap_base }}"
|
||||
community.general.ldap_entry:
|
||||
dn: "ou={{ org }},{{ ldap_base }}"
|
||||
bind_dn: "{{ binddn }}"
|
||||
|
||||
Reference in New Issue
Block a user