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

51 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2017-01-28 16:42:22 +01:00
---
- name: Install slapd
2017-07-02 22:17:32 +02:00
apt: name=slapd
2017-01-28 16:42:22 +01:00
2019-02-23 23:55:35 +01:00
- name: Install slapd-smbk5pwd
2017-07-02 22:17:32 +02:00
apt: name=slapd-smbk5pwd
2017-01-30 20:00:37 +01:00
when: slapd_role == "master"
2017-01-28 16:42:22 +01:00
- name: Remove slapd.d
file: path=/etc/ldap/slapd.d state=absent
notify: Restart slapd
- name: Copy schema definitons
copy: src={{ item }} dest=/etc/ldap/{{ item }}
with_items:
2019-11-28 22:40:51 +01:00
- schema/kitchen.schema
- schema/openssh-lpk.schema
2017-01-28 16:42:22 +01:00
- schema/radius.schema
- schema/samba.schema
notify: Restart slapd
- name: Configure slapd (init script)
copy: src=slapd dest=/etc/default/slapd
notify: Restart slapd
- name: Configure slapd
template: src=slapd.conf.j2 dest=/etc/ldap/slapd.conf
notify: Restart slapd
- name: Create certificate directory
file: path=/etc/ldap/ssl state=directory mode=0755
2017-01-28 16:42:22 +01:00
- 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
2019-03-25 19:05:31 +01:00
- name: Request nsupdate key for certificate
include_role: name=acme-dnskey-generate
vars:
acme_dnskey_san_domains:
- "{{ slapd_hostname }}"
- "{{ slapd_san }}"
- name: Configure certificate manager for slapd
2019-05-20 19:49:08 +02:00
template: src=certs.j2 dest=/etc/acertmgr/{{ slapd_hostname }}.conf
2019-03-25 19:05:31 +01:00
notify: Run acertmgr
2017-01-28 16:42:22 +01:00
- name: Start slapd
service: name=slapd state=started enabled=yes