Files
product-demos/linux/patching.yml
benblasco 33368cdc77 Run insights scan (skip errors if not configured) (Issue #32) (#48)
* Run insights scan (skip errors if not configured) (Issue #32)

* Improved Insights client checks to use facts
defined by redhatinsights.insights.insights_client role

* Fixed missed call to debug module

* Updated message for clarity

Co-authored-by: Benjamin Blasco <bblasco@redhat.com>
2023-01-05 11:25:48 -06:00

38 lines
886 B
YAML

---
- hosts: "{{ HOSTS }}"
become: yes
vars:
report_server: node1
tasks:
- include_role:
name: demo.patching.patch_linux
- name: Tell user when Insights Client is not configured
debug:
msg: "Insights client does not appear to be configured. Scan will be skipped"
when:
- ansible_local.insights.system_id is not defined
- name: Run the Insights Client Scan
command: insights-client
when:
- not ansible_check_mode
- ansible_local.insights.system_id is defined
- block:
- include_role:
name: "{{ item }}"
loop:
- demo.patching.report_server
- demo.patching.report_linux
- demo.patching.report_linux_patching
- include_role:
name: demo.patching.report_server
tasks_from: linux_landing_page
delegate_to: "{{ report_server }}"
run_once: yes