Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
solve issue #111
Browse files Browse the repository at this point in the history
  • Loading branch information
berndfinger committed Jan 27, 2021
1 parent 62a189f commit 4bc9f4c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
40 changes: 18 additions & 22 deletions tasks/RedHat/generic/assert-uuidd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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) }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/assert-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: list of required SAP Notes
- name: List required SAP Notes
debug:
var: __sap_preconfigure_sapnotes | difference([''])

Expand Down

0 comments on commit 4bc9f4c

Please sign in to comment.