diff --git a/ldap/defaults/main.yml b/ldap/defaults/main.yml index 88631a11..450c7a6c 100644 --- a/ldap/defaults/main.yml +++ b/ldap/defaults/main.yml @@ -1,4 +1,5 @@ --- ldap_hostname: "{{ ansible_hostname }}" +ldap_listen: "ldap://127.0.0.1:389/" ldap_domain: "{{ ansible_domain }}" ldap_suffix: "dc={{ ldap_hostname }},dc={{ ldap_domain.split('.')[-2] }},dc={{ ldap_domain.split('.')[-1] }}" diff --git a/ldap/tasks/main.yml b/ldap/tasks/main.yml index 84bed58d..ffecbad6 100644 --- a/ldap/tasks/main.yml +++ b/ldap/tasks/main.yml @@ -8,6 +8,13 @@ - ldapvi - shelldap +- name: change sldap listen ip:port + lineinfile: + dest: /etc/default/slapd + regexp: 'SLAPD_SERVICES=.*' + line: "SLAPD_SERVICES=\"{{ ldap_listen }}\"" + notify: restart slapd + - name: "Is /root/.ldapvirc present ?" stat: path: /root/.ldapvirc