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>
21 lines
602 B
YAML
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"
|