Browse Source

store ldap secret

python3
Andrea Cimbalo 7 years ago
parent
commit
5d4f6c32b3
1 changed files with 28 additions and 5 deletions
  1. +28
    -5
      roles/ldap/tasks/main.yaml

+ 28
- 5
roles/ldap/tasks/main.yaml View File

@ -22,21 +22,44 @@
question: 'shared/organization' question: 'shared/organization'
vtype: 'string' vtype: 'string'
value: '{{ ldap_organization }}' value: '{{ ldap_organization }}'
- name: generate admin password
gen_passwd: length=20
register: new_passwd
- name: slurp slap secret file
slurp:
src: /etc/slapd.secret
register: slapdsecret
failed_when: false
changed_when: false
- set_fact:
slapd_passwd: "{{ slapdsecret['content'] | b64decode }}"
when: '"content" in slapdsecret'
- block:
- name: generate admin password
gen_passwd: length=20
register: new_passwd
- name: store slapd secret
copy:
content : "{{ new_passwd.passwd }}"
dest: /etc/slapd.secret
- set_fact:
slapd_passwd: "{{ new_passwd.passwd }}"
when: 'not "content" in slapdsecret'
- name: configure OpenLDAP (password1) - name: configure OpenLDAP (password1)
debconf: debconf:
name: 'slapd' name: 'slapd'
question: 'slapd/password1' question: 'slapd/password1'
vtype: 'string' vtype: 'string'
value: '{{ new_passwd.passwd }}'
value: '{{ slapd_passwd }}'
- name: configure OpenLDAP (password2) - name: configure OpenLDAP (password2)
debconf: debconf:
name: 'slapd' name: 'slapd'
question: 'slapd/password2' question: 'slapd/password2'
vtype: 'string' vtype: 'string'
value: '{{ new_passwd.passwd }}'
value: '{{ slapd_passwd }}'
- name: configure phamm-ldap - name: configure phamm-ldap
debconf: debconf:
name: 'phamm-ldap' name: 'phamm-ldap'


Loading…
Cancel
Save