Files
product-demos/satellite/server_openscap.yml
willtome c18a206499 Merge of RedHatGov/product-demos (#56)
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>
2023-03-17 09:07:02 -04:00

21 lines
602 B
YAML

---
- name: Run openSCAP scan
hosts: "{{ _hosts | default(omit) }}"
become: true
vars:
policy_name: all
roles:
- demo.satellite.scap_client
tasks:
- name: Randomized startup delay...
ansible.builtin.pause:
seconds: "{{ 5 | random }}"
- name: Run SCAP Scan # noqa: no-changed-when - purpose is to run everytime
ansible.builtin.command: "/usr/bin/foreman_scap_client {{ item.id }}"
loop: "{{ policy }}"
when: policy_scan == 'all' or item.name in policy_scan
register: scap_cmd_output
failed_when: "'Error' in command_result.stderr"