diff --git a/tasks/install_ldap.yml b/tasks/install_ldap.yml index c2aba5e..fa1ae31 100644 --- a/tasks/install_ldap.yml +++ b/tasks/install_ldap.yml @@ -4,22 +4,22 @@ include_vars: "{{ ansible_os_family }}.yml" - name: Install the openldap and required Packages for RedHat - yum: name={{ item }} state=installed - with_items: openldap_server_pkgs + yum: name="{{ item }}" state=present + with_items: "{{ openldap_server_pkgs }}" when: ansible_os_family == 'RedHat' - name: Install the openldap and required Packages for Ubuntu - apt: name={{ item }} state=installed update_cache=yes - with_items: openldap_server_pkgs + apt: name="{{ item }}" state=present update_cache=yes + with_items: "{{ openldap_server_pkgs }}" environment: env when: ansible_os_family == 'Debian' - name: Delete the configuration directory - file: path={{ openldap_server_app_path }}/slapd.d state=absent + file: path="{{ openldap_server_app_path }}"/slapd.d state=absent - name: Generate the root password for ldap - shell: slappasswd -s {{ openldap_server_rootpw }} + shell: slappasswd -s {{ openldap_server_rootpw }} register: root_password - name: Copy the slapd.conf configuration file for Redhat diff --git a/templates/domain.ldif b/templates/domain.ldif index dab1703..5b9b6f5 100644 --- a/templates/domain.ldif +++ b/templates/domain.ldif @@ -1,4 +1,3 @@ dn: dc={{ openldap_server_domain_name.split('.')[0] }},dc={{ openldap_server_domain_name.split('.')[1] }} objectClass: domain dc: {{ openldap_server_domain_name.split('.')[0] }} - diff --git a/templates/ldap.conf.j2 b/templates/ldap.conf.j2 index 6f8d3fc..b0a346e 100644 --- a/templates/ldap.conf.j2 +++ b/templates/ldap.conf.j2 @@ -23,4 +23,4 @@ TLS_CACERT /etc/openldap/certs/cert.crt {% endif %} {% if ansible_os_family == 'Debian' %} TLS_CACERT /etc/ldap/certs/cert.crt -{% endif %} +{% endif %} \ No newline at end of file diff --git a/templates/slapd.conf.j2 b/templates/slapd.conf.j2 index 3f699d5..762ec08 100644 --- a/templates/slapd.conf.j2 +++ b/templates/slapd.conf.j2 @@ -33,4 +33,4 @@ index nisMapName,nisMapEntry eq,pres,sub TLSCipherSuite HIGH:MEDIUM:+SSLv2 #TLSCACertificateFile /etc/openldap/certs/cacert.pem TLSCertificateFile /etc/openldap/certs/cert.crt -TLSCertificateKeyFile /etc/openldap/certs/my.key +TLSCertificateKeyFile /etc/openldap/certs/my.key \ No newline at end of file diff --git a/templates/slapd.conf_ubuntu.j2 b/templates/slapd.conf_ubuntu.j2 index f256ed6..2df4083 100644 --- a/templates/slapd.conf_ubuntu.j2 +++ b/templates/slapd.conf_ubuntu.j2 @@ -38,4 +38,4 @@ index uid,memberUid eq,pres,sub index nisMapName,nisMapEntry eq,pres,sub #TLSCACertificateFile /etc/ldap/certs/cacert.pem TLSCertificateFile /etc/ldap/certs/cert.crt -TLSCertificateKeyFile /etc/ldap/certs/my.key +TLSCertificateKeyFile /etc/ldap/certs/my.key \ No newline at end of file