diff --git a/tasks/RedHat/generic/assert-uuidd.yml b/tasks/RedHat/generic/assert-uuidd.yml index 4a0dae0..583619d 100644 --- a/tasks/RedHat/generic/assert-uuidd.yml +++ b/tasks/RedHat/generic/assert-uuidd.yml @@ -3,33 +3,30 @@ - debug: msg: "imported RedHat/generic/assert-uuidd.yml" -- name: Get status of uuidd - command: systemctl status uuidd - register: uuidd_status - ignore_errors: yes - changed_when: no +- name: Assert that uuidd.service exists + assert: + that: + - "'uuidd.service' in ansible_facts.services" + fail_msg: "FAIL: Service uuidd could not be found!" + success_msg: "PASS: Service uuidd is available." + ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" + +# uuidd is started on demand by uuidd.socket, so it does not need to be running: +- name: Report uuidd service status + debug: + msg: "INFO: The uuidd service is in status '{{ ansible_facts.services['uuidd.service']['status'] }}' and in state '{{ ansible_facts.services['uuidd.service']['state'] }}'." + when: "'uuidd.service' in ansible_facts.services" +# uuidd.socket is not contained in ansible_facts.services, so we need to get the status from systemctl: - name: Get status of uuidd.socket command: systemctl status uuidd.socket register: uuidd_socket_status ignore_errors: yes changed_when: no -- name: Assert that uuidd is enabled (indirect) - assert: - that: - - "'/usr/lib/systemd/system/uuidd.service; indirect' in uuidd_status.stdout" - fail_msg: "FAIL: Service uuidd is not enabled!" - success_msg: "PASS: Service uuidd is enabled." - ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" - -- name: Assert that uuidd is active - assert: - that: - - "'active (running)' in uuidd_status.stdout" - fail_msg: "FAIL: Service uuidd is not active!" - success_msg: "PASS: Service uuidd is active." - ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" +- name: Report uuidd.socket service status + debug: + var: uuidd_socket_status.stdout - name: Assert that uuidd.socket is enabled assert: @@ -41,8 +38,7 @@ - name: Assert that uuidd.socket is active assert: - that: - - "'active (running)' in uuidd_socket_status.stdout" + that: "'active (running)' in uuidd_socket_status.stdout or 'active (listening)' in uuidd_socket_status.stdout" fail_msg: "FAIL: Service uuidd.socket is not active!" success_msg: "PASS: Service uuidd.socket is active." ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" diff --git a/tasks/assert-configuration.yml b/tasks/assert-configuration.yml index 5144981..c990a73 100644 --- a/tasks/assert-configuration.yml +++ b/tasks/assert-configuration.yml @@ -1,6 +1,6 @@ --- -- name: list of required SAP Notes +- name: List required SAP Notes debug: var: __sap_preconfigure_sapnotes | difference([''])