cleanup
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
- name: Find main LDAP database DN
|
||||
ansible.builtin.command: >
|
||||
command: >
|
||||
ldapsearch -Y EXTERNAL -H ldapi:/// \
|
||||
-b cn=config '(olcSuffix={{ ldap_basedn }})' dn
|
||||
register: ldap_db_dn
|
||||
changed_when: false
|
||||
|
||||
- name: Set fact for main database DN
|
||||
ansible.builtin.set_fact:
|
||||
set_fact:
|
||||
ldap_main_db_dn: "{{ ldap_db_dn.stdout_lines | select('match','^dn:') | first | regex_replace('^dn: ','') }}"
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
---
|
||||
# roles/ldap_server/tasks/schemas.yml
|
||||
- name: Ensure LDAP core schema is loaded
|
||||
ansible.builtin.command: >
|
||||
command: >
|
||||
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/core.ldif
|
||||
args:
|
||||
creates: /etc/openldap/schema/.core_loaded
|
||||
|
||||
- name: Ensure LDAP cosine schema is loaded
|
||||
ansible.builtin.command: >
|
||||
command: >
|
||||
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif
|
||||
args:
|
||||
creates: /etc/openldap/schema/.cosine_loaded
|
||||
|
||||
- name: Ensure LDAP inetorgperson schema is loaded
|
||||
ansible.builtin.command: >
|
||||
command: >
|
||||
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif
|
||||
args:
|
||||
creates: /etc/openldap/schema/.inetorgperson_loaded
|
||||
|
||||
- name: Ensure LDAP nis schema is loaded
|
||||
ansible.builtin.command: >
|
||||
command: >
|
||||
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif
|
||||
args:
|
||||
creates: /etc/openldap/schema/.nis_loaded
|
||||
@@ -41,7 +41,7 @@
|
||||
mode: '0600'
|
||||
|
||||
- name: Ensure custom LDAP schemas (sudo + openssh) are loaded
|
||||
ansible.builtin.command: >
|
||||
command: >
|
||||
ldapadd -Y EXTERNAL -H ldapi:/// -f {{ item.file }}
|
||||
args:
|
||||
creates: "/etc/openldap/schema/.{{ item.name }}_loaded"
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
# Touch marker files for idempotency (optional but recommended)
|
||||
- name: Ensure marker files exist
|
||||
ansible.builtin.file:
|
||||
file:
|
||||
path: "/etc/openldap/schema/.{{ item.name }}_loaded"
|
||||
state: touch
|
||||
loop:
|
||||
@@ -62,5 +62,5 @@
|
||||
- { name: "inetorgperson" }
|
||||
- { name: "nis" }
|
||||
# - { name: "sudo" }
|
||||
# - { name: "openssh" }
|
||||
- { name: "openssh" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user