File: ansible.template

package info (click to toggle)
scap-security-guide 0.1.76-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 110,644 kB
  • sloc: xml: 241,883; sh: 73,777; python: 32,527; makefile: 27
file content (21 lines) | stat: -rw-r--r-- 713 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# platform = multi_platform_all
# reboot = false
# strategy = disable
# complexity = low
# disruption = low

# Currently, Ansible can only collect systemd facts about service units. Socket units are needed.
- name: "{{{ rule_title }}} - Collect systemd Socket Units Present in the System"
  ansible.builtin.command:
    cmd: systemctl -q list-unit-files --type socket
  register: result_systemd_unit_files
  changed_when: false

- name: "{{{ rule_title }}} - Ensure {{{ SOCKETNAME }}}.socket is Masked"
  ansible.builtin.systemd:
    name: {{{ SOCKETNAME }}}.socket
    state: stopped
    enabled: false
    masked: true
  when:
    - result_systemd_unit_files.stdout_lines is search("{{{ SOCKETNAME }}}.socket")