1
0
forked from infra/ansible
infra/roles/slapd/tasks/main.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

2017-01-28 16:42:22 +01:00
---
- name: Install slapd
apt: name={{ item }} state=present
with_items:
- slapd
tags: ldap
2017-01-30 20:00:37 +01:00
- name: Install slapd
apt: name={{ item }} state=present
with_items:
- slapd-smbk5pwd
when: slapd_role == "master"
tags: ldap
2017-01-28 16:42:22 +01:00
- name: Remove slapd.d
file: path=/etc/ldap/slapd.d state=absent
notify: Restart slapd
tags: ldap
- name: Copy schema definitons
copy: src={{ item }} dest=/etc/ldap/{{ item }}
with_items:
- schema/radius.schema
- schema/samba.schema
- schema/kitchen.schema
notify: Restart slapd
tags: ldap
- name: Configure slapd (init script)
copy: src=slapd dest=/etc/default/slapd
notify: Restart slapd
tags: ldap
- name: Configure slapd
template: src=slapd.conf.j2 dest=/etc/ldap/slapd.conf
notify: Restart slapd
tags: ldap
- name: Ensure certificates are available
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/ldap/ssl/srv.key -out /etc/ldap/ssl/srv.crt -days 730 -subj "/CN={{ slapd_hostname }}" creates=/etc/ldap/ssl/srv.crt
notify: Restart slapd
2017-02-28 14:48:03 +01:00
tags: ldap
2017-01-28 16:42:22 +01:00
- name: Start slapd
service: name=slapd state=started enabled=yes
tags: ldap