]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Retrieving the admin password of the LDAP server
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 9 Dec 2024 14:26:31 +0000 (15:26 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 9 Dec 2024 14:26:31 +0000 (15:26 +0100)
inventory/dpx-ldap-dev1.yaml
inventory/spk-ldap-stage.yaml
roles/389ds-check-initial/tasks/main.yaml

index 25e901b543c160027d66a19977f47607ec2f1ca4..7f660e2d72086cfd123903240f7abbbd56976b10 100644 (file)
@@ -6,12 +6,15 @@ all:
         dev-ds01.pixelpark.com:
           replica_id: 1
           slapd_instance: dev-ds01
+          ldap_uri: 'ldaps://dev-ds01.pixelpark.com'
         dev-ds02.pixelpark.com:
           replica_id: 2
           slapd_instance: dev-ds02
+          ldap_uri: 'ldaps://dev-ds02.pixelpark.com'
         dev-ds03.pixelpark.com:
           replica_id: 3
           slapd_instance: dev-ds03
+          ldap_uri: 'ldaps://dev-ds03.pixelpark.com'
     haproxy_servers:
       hosts:
         dev-ds-hap01.pixelpark.com: {}
@@ -25,6 +28,7 @@ all:
     replication_manager_password_file: '/root/.private/dirserv-repl-mngr-pwd.txt'
     replication_manager_idle_timeout: 0
     haproxy_backend_name: 'be-ldap-dev1'
+    ldaps_validate_certs: false
     # ds389_plugin_attr_uniq_purge: false
     ds389_plugin_attr_uniq_attributes:
       'uid':
index f536d71a33f6a71263d8104626fc9615e8e03c45..cbe8ee6e3c8e7905a173b5f19314923c5f2c63e1 100644 (file)
@@ -6,9 +6,11 @@ all:
         stage-ds01-spk.spk.pixelpark.net:
           replica_id: 1
           slapd_instance: stage-ds01-spk
+          ldap_uri: 'ldaps://stage-ds01-spk.spk.pixelpark.net'
         stage-ds02-spk.spk.pixelpark.net:
           replica_id: 2
           slapd_instance: stage-ds02-spk
+          ldap_uri: 'ldaps://stage-ds02-spk.spk.pixelpark.net'
     haproxy_servers:
       hosts:
         live-ldap-hap01.spk.pixelpark.net: {}
@@ -22,6 +24,7 @@ all:
     replication_manager_password_file: '/root/.private/dirserv-repl-mngr-pwd.txt'
     replication_manager_idle_timeout: 0
     haproxy_backend_name: 'be-stage-ldap'
+    ldaps_validate_certs: false
     ds389_plugin_attr_uniq_config: false
     # ds389_plugin_attr_uniq_purge: false
     ds389_plugin_attr_uniq_attributes:
index ea6ed1502dd85c3648dab56fe85f47285109d9da..d1fc740fcddddb6e6d426a542f013917d49536da 100644 (file)
     msg: "The Directory Server instances '{{ slapd_instance }}' was not found on '{{ inventory_hostname }}'."
   when: slapd_instance not in instances_389ds
 
+- name: 'Get the admin password from the password file.'
+  ansible.builtin.shell: "cat {{ dirsrv_root_passwd_file | quote }}"
+  register: get_dirsrv_root_passwd
+  check_mode: false
+  changed_when: false
+  no_log: true
+
+- name: 'Get the admin password.'
+  ansible.builtin.set_fact:
+    dirsrv_root_passwd: "{{ get_dirsrv_root_passwd.stdout }}"
+  no_log: true
+
+- name: 'Got no admin password'
+  ansible.builtin.fail:
+    msg: "Did not found a password in file {{ dirsrv_root_passwd_file || quote }}."
+  when: dirsrv_root_passwd == ''
 
 # vim: filetype=yaml