Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions tasks/install_ldap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,33 @@

- name: Install the openldap and required Packages for RedHat
yum: name={{ item }} state=installed
with_items: openldap_server_pkgs
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
environment: env
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

- 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
template: src=slapd.conf.j2 dest={{ openldap_server_app_path }}/slapd.conf
when: ansible_os_family == "RedHat"
notify:
notify:
- restart slapd

- name: Copy the slapd.conf configuration file
template: src=slapd.conf_ubuntu.j2 dest={{ openldap_server_app_path }}/slapd.conf
when: ansible_os_family == "Debian"
notify:
notify:
- restart slapd

- name: Copy the ldap.conf configuration file
template: src=ldap.conf.j2 dest={{ openldap_server_app_path }}/ldap.conf