|
| 1 | +--- |
| 2 | +- name: Gather service facts |
| 3 | + ansible.builtin.service_facts: |
| 4 | + |
| 5 | +- name: Check core services are running |
| 6 | + ansible.builtin.assert: |
| 7 | + that: |
| 8 | + - "ansible_facts.services[item + '.service'] is defined" |
| 9 | + - "ansible_facts.services[item + '.service']['state'] == 'running'" |
| 10 | + fail_msg: "Service {{ item }} is not running" |
| 11 | + success_msg: "Service {{ item }} is running" |
| 12 | + loop: |
| 13 | + - foreman |
| 14 | + - httpd |
| 15 | + - redis |
| 16 | + - postgresql |
| 17 | + |
| 18 | +- name: Check dynflow services are running |
| 19 | + ansible.builtin.assert: |
| 20 | + that: |
| 21 | + - "ansible_facts.services[item + '.service'] is defined" |
| 22 | + - "ansible_facts.services[item + '.service']['state'] == 'running'" |
| 23 | + fail_msg: "Service {{ item }} is not running" |
| 24 | + success_msg: "Service {{ item }} is running" |
| 25 | + loop: |
| 26 | + - dynflow-sidekiq@orchestrator |
| 27 | + - dynflow-sidekiq@worker |
| 28 | + - dynflow-sidekiq@worker-hosts-queue |
| 29 | + |
| 30 | +- name: Check Pulp services are running |
| 31 | + ansible.builtin.assert: |
| 32 | + that: |
| 33 | + - "ansible_facts.services[item + '.service'] is defined" |
| 34 | + - "ansible_facts.services[item + '.service']['state'] == 'running'" |
| 35 | + fail_msg: "Service {{ item }} is not running" |
| 36 | + success_msg: "Service {{ item }} is running" |
| 37 | + loop: |
| 38 | + - pulp-api |
| 39 | + - pulp-content |
| 40 | + when: enabled_features | has_content_features |
| 41 | + |
| 42 | +- name: Check Candlepin service is running |
| 43 | + ansible.builtin.assert: |
| 44 | + that: |
| 45 | + - "ansible_facts.services['candlepin.service'] is defined" |
| 46 | + - "ansible_facts.services['candlepin.service']['state'] == 'running'" |
| 47 | + fail_msg: "Service candlepin is not running" |
| 48 | + success_msg: "Service candlepin is running" |
| 49 | + when: enabled_features | has_content_features |
0 commit comments