Co-authored-by: MKletz <michael.kletz.27@gmail.com> Co-authored-by: Ajay Chenampara <ajay.chenampara@gmail.com> Co-authored-by: dlemons-redhat <69318976+dlemons-redhat@users.noreply.github.com> Co-authored-by: Nicolas Leiva <nicolasleiva@gmail.com> Co-authored-by: benblasco <42140583+benblasco@users.noreply.github.com> Co-authored-by: Benjamin Blasco <bblasco@redhat.com> Co-authored-by: calvingsmith <4283930+calvingsmith@users.noreply.github.com> Co-authored-by: Calvin Smith <calvingsmith@users.noreply.github.com> Co-authored-by: Hicham Mourad <43329991+HichamMourad@users.noreply.github.com>
26 lines
863 B
YAML
26 lines
863 B
YAML
---
|
|
- name: Run compliance scan with Red Hat Insights
|
|
hosts: "{{ _hosts | default(omit) }}"
|
|
become: true
|
|
vars:
|
|
compliance_profile_configured: undef
|
|
|
|
tasks:
|
|
- name: Check OS Type
|
|
ansible.builtin.assert:
|
|
that: "ansible_os_family == 'RedHat'"
|
|
|
|
- name: Check variable values
|
|
ansible.builtin.debug:
|
|
msg: "Value of compliance_profile_configured is {{ compliance_profile_configured }}"
|
|
|
|
- name: Run Insights Compliance scan
|
|
ansible.builtin.import_role:
|
|
name: redhat.insights.compliance
|
|
when: compliance_profile_configured == "Yes"
|
|
|
|
- name: Notify user that Compliance scan is not being attempted
|
|
ansible.builtin.debug:
|
|
msg: "User has not confirmed that all hosts are associated with an Insights Compliance profile. Scan aborted."
|
|
when: compliance_profile_configured == "No"
|