From b3ec1f09b6d0b4a1db6805d49ce0f0c8af4b57a0 Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Mon, 18 Dec 2017 18:05:37 +0100 Subject: [PATCH] slapd: listen on 127.0.0.1:389 by default --- ldap/defaults/main.yml | 1 + ldap/tasks/main.yml | 7 +++++++ 2 files changed, 8 insertions(+) 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