Skip to content

Commit

Permalink
dirsrv_install_additional_ldif fails on CentOS 8 #18
Browse files Browse the repository at this point in the history
Add dirsrv_install_additional_ldif_dir variable and store ldif files there
  • Loading branch information
lvps committed Jun 2, 2021
1 parent 7fb6fe0 commit 94893e1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
galaxy_info:
author: lvps
role_name: 389ds_server
description: >
Installs 389DS LDAP server. Also configures TLS, logging, custom schema
files, enable/disable plugins, DNA plugin for UID/GID, LDAPI and SASL PLAIN.
Expand Down
40 changes: 34 additions & 6 deletions tasks/install_389ds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,29 @@
mode: '600'
when: not dirsrv_instance_dir_exists

- name: Copy additional ldif files
- name: Copy additional ldif files (setup-ds.pl)
copy:
src: "{{ item }}"
dest: "/tmp/{{ item | basename }}"
dest: "{% if dirsrv_legacy %}/tmp/{% else %}{{ dirsrv_install_additional_ldif_dir }}/{% endif %}{{ item | basename }}"
mode: '400'
owner: dirsrv
group: dirsrv
when: not dirsrv_instance_dir_exists
when:
- not dirsrv_instance_dir_exists
- dirsrv_legacy
loop: "{{ dirsrv_install_additional_ldif }}"

- name: Set SELinux context for additional ldif files
- name: Set SELinux context for additional ldif files (setup-ds.pl)
sefcontext:
setype: user_tmp_t
seuser: unconfined_u
state: present
target: "/tmp/{{ item | basename }}"
target: "{% if dirsrv_legacy %}/tmp/{% else %}{{ dirsrv_install_additional_ldif_dir }}/{% endif %}{{ item | basename }}"
when:
- not dirsrv_instance_dir_exists
- ansible_selinux is defined
- ansible_selinux.status == 'enabled'
- dirsrv_legacy
loop: "{{ dirsrv_install_additional_ldif }}"

# This will install the Directory Server *only*.
Expand All @@ -84,6 +87,31 @@
- not dirsrv_instance_dir_exists
- not dirsrv_legacy

- name: Copy additional ldif files (dsconf)
copy:
src: "{{ item }}"
dest: "{{ dirsrv_install_additional_ldif_dir }}/{{ item | basename }}"
mode: '400'
owner: dirsrv
group: dirsrv
when:
- not dirsrv_instance_dir_exists
- not dirsrv_legacy
loop: "{{ dirsrv_install_additional_ldif }}"

- name: Set SELinux context for additional ldif files (dsconf)
sefcontext:
setype: user_tmp_t
seuser: unconfined_u
state: present
target: "{{ dirsrv_install_additional_ldif_dir }}/{{ item | basename }}"
when:
- not dirsrv_instance_dir_exists
- ansible_selinux is defined
- ansible_selinux.status == 'enabled'
- not dirsrv_legacy
loop: "{{ dirsrv_install_additional_ldif }}"

# The newer version of the install.ini file does not have a InstallLdifFile object anymore
# So we manually install extra ldifs later
- name: Install additional ldif files (dsconf)
Expand All @@ -93,7 +121,7 @@
-w {{ dirsrv_rootdn_password }}
ldap://{{ dirsrv_fqdn }}
backend import userRoot
/tmp/{{ item|basename }}
{{ dirsrv_install_additional_ldif_dir }}/{{ item|basename }}
when:
- not dirsrv_instance_dir_exists
- not dirsrv_legacy
Expand Down

0 comments on commit 94893e1

Please sign in to comment.