From 920090fe0d5cb9b3db673e34fd591b2401b3804a Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 9 Dec 2024 15:58:00 +0100 Subject: [PATCH] Checking the admin password file of the LDAP server --- inventory/dpx-ldap-dev1.yaml | 1 + roles/389ds-check-initial/tasks/main.yaml | 20 ++++++++++++++++++++ roles/haproxy-check-initial/tasks/main.yaml | 6 +++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/inventory/dpx-ldap-dev1.yaml b/inventory/dpx-ldap-dev1.yaml index 7f660e2..7c31f20 100644 --- a/inventory/dpx-ldap-dev1.yaml +++ b/inventory/dpx-ldap-dev1.yaml @@ -61,4 +61,5 @@ all: 'blaBlub': ensure: absent + # vim: filetype=yaml diff --git a/roles/389ds-check-initial/tasks/main.yaml b/roles/389ds-check-initial/tasks/main.yaml index d1fc740..1878d62 100644 --- a/roles/389ds-check-initial/tasks/main.yaml +++ b/roles/389ds-check-initial/tasks/main.yaml @@ -61,6 +61,26 @@ msg: "The Directory Server instances '{{ slapd_instance }}' was not found on '{{ inventory_hostname }}'." when: slapd_instance not in instances_389ds +- name: "Get file stat of Directory Server admin password file ..." + ansible.builtin.stat: + path: "{{ dirsrv_root_passwd_file }}" + register: dirsrv_admin_passwd_file + +- name: "File stat of Directory Server admin password file: " + debug: + var: dirsrv_admin_passwd_file + verbosity: 3 + +- name: "Check existence of Directory Server admin password file." + ansible.builtin.fail: + msg: "The Directory Server admin password file {{ dirsrv_root_passwd_file | quote }} does not exists." + when: dirsrv_admin_passwd_file.stat.exists != true + +- name: "Checking, whether Directory Server admin password file is a regular file." + ansible.builtin.fail: + msg: "The path {{ dirsrv_root_passwd_file | quote }} for the Directory Server admin password file is not a regular file." + when: dirsrv_admin_passwd_file.stat.isreg != true + - name: 'Get the admin password from the password file.' ansible.builtin.shell: "cat {{ dirsrv_root_passwd_file | quote }}" register: get_dirsrv_root_passwd diff --git a/roles/haproxy-check-initial/tasks/main.yaml b/roles/haproxy-check-initial/tasks/main.yaml index 9875965..2fb86c4 100644 --- a/roles/haproxy-check-initial/tasks/main.yaml +++ b/roles/haproxy-check-initial/tasks/main.yaml @@ -43,7 +43,7 @@ msg: "The HAProxy admin socket '{{ haproxy_admin_socket }}' does not exists." when: admin_socket.stat.exists != true -- name: "Checking, whether '{{ haproxy_admin_socket }}' is a socket." +- name: "Checking, whether HAProxy admin socket path is a socket." ansible.builtin.fail: msg: "The path '{{ haproxy_admin_socket }}' for the HAProxy admin socket is not a socket." when: admin_socket.stat.issock != true @@ -63,7 +63,7 @@ msg: "The HAProxy operator socket '{{ haproxy_operator_socket }}' does not exists." when: operator_socket.stat.exists != true -- name: "Checking, whether '{{ haproxy_operator_socket }}' is a socket." +- name: "Checking, whether HAProxy operator socket path is a socket." ansible.builtin.fail: msg: "The path '{{ haproxy_operator_socket }}' for the HAProxy operator socket is not a socket." when: operator_socket.stat.issock != true @@ -83,7 +83,7 @@ msg: "The HAProxy user socket '{{ haproxy_user_socket }}' does not exists." when: user_socket.stat.exists != true -- name: "Checking, whether '{{ haproxy_user_socket }}' is a socket." +- name: "Checking, whether HAProxy user socket path is a socket." ansible.builtin.fail: msg: "The path '{{ haproxy_user_socket }}' for the HAProxy user socket is not a socket." when: user_socket.stat.issock != true -- 2.39.5