From 39a49698bcde9715d519fe43121d265e557baa7b Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Wed, 3 Jul 2019 17:23:07 +0200 Subject: [PATCH] role slapd: mise au point verification insertion schema --- tasks/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 3ddf3d7..cfda816 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -21,17 +21,18 @@ values: "{{ item.value }}" state: exact with_dict: + olcSuffix: "{{ ldap_suffix }}" olcRootDN: "{{ ldap_admin_dn }}" olcRootPW: "{{ ldap_admin_password }}" - olcSuffix: "{{ ldap_suffix }}" -- name: check if schema already loaded - command: ldapsearch -Y EXTERNAL -H ldapi:/// -b cn=schema,cn=config -LLL olcObjectClasses='*0.9.2342.19200300.100.4.13 NAME*' dn +- name: check if schema cosine is loaded + stat: + path: /etc/openldap/slapd.d/cn=config/cn=schema/cn={1}cosine.ldif register: result - name: import mandatory schema command: "ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif" - when: not result.stdout.find( 'cosine,cn=schema,cn=config' ) + when: result.stat.exists==False - name: create suffix ldap_entry: