Files
product-demos/satellite/server_openscap.yml
2023-03-07 16:55:34 -05:00

20 lines
539 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
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"