overwrite systemd file on rh-8
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Robert Kaussow 2022-02-12 13:25:54 +01:00
parent a3d28a65f9
commit c9e395822e
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
6 changed files with 30 additions and 1 deletions

View File

@ -1,9 +1,10 @@
---
ldap_proxy_base_dir: /etc/openldap
ldap_proxy_urls:
- "ldapi:/// ldap:///"
ldap_proxy_options: []
ldap_proxy_base_dir: /etc/openldap
ldap_proxy_tls_enabled: False
ldap_proxy_tls_cert_source: mycert.pem
ldap_proxy_tls_key_source: mykey.pem

View File

@ -4,6 +4,7 @@
service:
state: restarted
name: slapd
daemon_reload: yes
listen: __slapd_restart
become: True
become_user: root

View File

@ -14,6 +14,19 @@
- include_tasks: overwrites.yml
- include_tasks: setup.yml
- include_tasks: "{{ task_files }}"
vars:
task_files: "{{ lookup('first_found', params, errors='ignore') }}"
params:
files:
- "setup_{{ ansible_lsb.id | default('') | lower }}.yml"
- "setup_{{ ansible_os_family | lower }}{{ ansible_distribution_major_version }}.yml"
- "setup_{{ ansible_os_family | lower }}.yml"
paths:
- "tasks"
when: task_files
- import_tasks: tls.yml
when: ldap_proxy_tls_enabled | bool
- include_tasks: post_tasks.yml

View File

@ -4,5 +4,6 @@
state: started
enabled: yes
name: slapd
daemon_reload: yes
become: True
become_user: root

7
tasks/setup_redhat8.yml Normal file
View File

@ -0,0 +1,7 @@
---
- name: Setup custom systemd service
template:
src: etc/systemd/system/slapd.service.j2
dest: "/etc/systemd/system/slapd.service"
mode: 0644
notify: __slapd_restart

View File

@ -0,0 +1,6 @@
[Service]
Type=forking
Environment="SLAPD_URLS=ldap:/// ldaps:/// ldapi:///" "SLAPD_OPTIONS="
EnvironmentFile=/etc/sysconfig/slapd
ExecStart=
ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS