Compare commits

..

No commits in common. "d188a70ff561aa448ac4bc26a288a21df4b4ed45" and "366f6c036ae110c78749e0e11aab78db461ff1fb" have entirely different histories.

11 changed files with 13 additions and 87 deletions

View file

@ -9,18 +9,10 @@ collections:
- src: git+https://guardianproject.dev/sr2/ansible-collection-core.git - src: git+https://guardianproject.dev/sr2/ansible-collection-core.git
version: "main" version: "main"
roles: roles:
- src: git+https://guardianproject.dev/sr2/RHEL9-CIS.git - src: git+https://github.com/ansible-lockdown/RHEL9-CIS.git
version: "2.0.3-become" version: "2.0.3"
``` ```
## Convention
We assume that these roles will be run initially as root, and then as an unprivileged user after initial bootstrap.
Some hardening may only be performed in the second run when we can see that the unprivileged user access is configured
and root access is no longer required.
If anything fails due to permissions when running as an unprivileged user, please report that in our
[issue tracker](https://guardianproject.dev/sr2/ansible-collection-core/issues).
## Licence ## Licence
Copyright © SR2 Communications Limited 2021-2025. Copyright © SR2 Communications Limited 2021-2025.

View file

@ -39,10 +39,3 @@
tags: bootstrap tags: bootstrap
- role: sr2c.core.podman_keycloak - role: sr2c.core.podman_keycloak
tags: keycloak tags: keycloak
- name: Baseline for generic servers (manual or externally managed application deployment)
hosts:
- generic
roles:
- role: sr2c.core.baseline
tags: bootstrap

View file

@ -2,11 +2,9 @@
- name: Regenerate grub config - name: Regenerate grub config
ansible.builtin.command: ansible.builtin.command:
cmd: grub2-mkconfig -o /boot/grub2/grub.cfg cmd: grub2-mkconfig -o /boot/grub2/grub.cfg
become: true
- name: Restart systemd-resolved - name: Restart systemd-resolved
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: systemd-resolved name: systemd-resolved
state: restarted state: restarted
daemon_reload: true daemon_reload: true
become: true

View file

@ -12,13 +12,11 @@
msg: "Variable 'baseline_second_disk_device' must be defined." msg: "Variable 'baseline_second_disk_device' must be defined."
- name: Disk Partitions | PATCH | Ensure lvm2 is installed - name: Disk Partitions | PATCH | Ensure lvm2 is installed
become: true
ansible.builtin.package: ansible.builtin.package:
name: lvm2 name: lvm2
state: present state: present
- name: Disk Partitions | PATCH | Create LVM partition spanning entire disk - name: Disk Partitions | PATCH | Create LVM partition spanning entire disk
become: true
community.general.parted: community.general.parted:
device: "{{ baseline_second_disk_device }}" device: "{{ baseline_second_disk_device }}"
number: 1 number: 1
@ -28,41 +26,35 @@
part_end: "100%" part_end: "100%"
- name: Disk Partitions | PATCH | Create volume group - name: Disk Partitions | PATCH | Create volume group
become: true
community.general.lvg: community.general.lvg:
vg: "{{ baseline_second_disk_vg_name }}" vg: "{{ baseline_second_disk_vg_name }}"
pvs: "{{ baseline_second_disk_device }}1" pvs: "{{ baseline_second_disk_device }}1"
- name: Disk Partitions | PATCH | Create /var logical volume - name: Disk Partitions | PATCH | Create /var logical volume
become: true
community.general.lvol: community.general.lvol:
vg: "{{ baseline_second_disk_vg_name }}" vg: "{{ baseline_second_disk_vg_name }}"
lv: var lv: var
size: "{{ baseline_second_disk_var_size }}" size: "{{ baseline_second_disk_var_size }}"
- name: Disk Partitions | PATCH | Create /var/log logical volume - name: Disk Partitions | PATCH | Create /var/log logical volume
become: true
community.general.lvol: community.general.lvol:
vg: "{{ baseline_second_disk_vg_name }}" vg: "{{ baseline_second_disk_vg_name }}"
lv: var_log lv: var_log
size: "{{ baseline_second_disk_var_log_size }}" size: "{{ baseline_second_disk_var_log_size }}"
- name: Disk Partitions | PATCH | Create /var/log/audit logical volume - name: Disk Partitions | PATCH | Create /var/log/audit logical volume
become: true
community.general.lvol: community.general.lvol:
vg: "{{ baseline_second_disk_vg_name }}" vg: "{{ baseline_second_disk_vg_name }}"
lv: var_log_audit lv: var_log_audit
size: "{{ baseline_second_disk_var_log_audit_size }}" size: "{{ baseline_second_disk_var_log_audit_size }}"
- name: Disk Partitions | PATCH | Create /var/tmp logical volume - name: Disk Partitions | PATCH | Create /var/tmp logical volume
become: true
community.general.lvol: community.general.lvol:
vg: "{{ baseline_second_disk_vg_name }}" vg: "{{ baseline_second_disk_vg_name }}"
lv: var_tmp lv: var_tmp
size: "{{ baseline_second_disk_var_tmp_size }}" size: "{{ baseline_second_disk_var_tmp_size }}"
- name: Disk Partitions | PATCH | Create /home logical volume with remaining space - name: Disk Partitions | PATCH | Create /home logical volume with remaining space
become: true
community.general.lvol: community.general.lvol:
vg: "{{ baseline_second_disk_vg_name }}" vg: "{{ baseline_second_disk_vg_name }}"
lv: home lv: home
@ -70,13 +62,11 @@
size: "100%FREE" size: "100%FREE"
- name: Disk Partitions | PATCH | Ensure cryptsetup is installed - name: Disk Partitions | PATCH | Ensure cryptsetup is installed
become: true
ansible.builtin.package: ansible.builtin.package:
name: cryptsetup name: cryptsetup
state: present state: present
- name: Disk Partitions | PATCH | Encrypt /home with LUKS2 and provided passphrase - name: Disk Partitions | PATCH | Encrypt /home with LUKS2 and provided passphrase
become: true
community.crypto.luks_device: community.crypto.luks_device:
device: "/dev/{{ baseline_second_disk_vg_name }}/home" device: "/dev/{{ baseline_second_disk_vg_name }}/home"
state: present state: present
@ -84,7 +74,6 @@
type: luks2 type: luks2
- name: Disk Partitions | PATCH | Open LUKS device - name: Disk Partitions | PATCH | Open LUKS device
become: true
community.crypto.luks_device: community.crypto.luks_device:
device: "/dev/{{ baseline_second_disk_vg_name }}/home" device: "/dev/{{ baseline_second_disk_vg_name }}/home"
name: home_crypt name: home_crypt
@ -92,7 +81,6 @@
passphrase: "{{ baseline_home_luks_passphrase }}" passphrase: "{{ baseline_home_luks_passphrase }}"
- name: Disk Partitions | PATCH | Add /home logical volume to crypttab - name: Disk Partitions | PATCH | Add /home logical volume to crypttab
become: true
community.general.crypttab: community.general.crypttab:
backing_device: /dev/mapper/datavg-home backing_device: /dev/mapper/datavg-home
name: home_crypt name: home_crypt
@ -100,7 +88,6 @@
state: present state: present
- name: Disk Partitions | PATCH | Create xfs filesystems on new partitions - name: Disk Partitions | PATCH | Create xfs filesystems on new partitions
become: true
community.general.filesystem: community.general.filesystem:
dev: "{{ item }}" dev: "{{ item }}"
fstype: xfs fstype: xfs
@ -112,7 +99,6 @@
- /dev/mapper/home_crypt - /dev/mapper/home_crypt
- name: Disk Partitions | AUDIT | Check if /home is mounted - name: Disk Partitions | AUDIT | Check if /home is mounted
become: true
ansible.builtin.command: ansible.builtin.command:
cmd: mountpoint -q /home cmd: mountpoint -q /home
register: baseline_second_disk_home_mounted register: baseline_second_disk_home_mounted
@ -120,7 +106,6 @@
failed_when: false failed_when: false
- name: Disk Partitions | AUDIT | Check if /home is empty - name: Disk Partitions | AUDIT | Check if /home is empty
become: true
ansible.builtin.command: ansible.builtin.command:
cmd: ls -A /home cmd: ls -A /home
register: baseline_second_disk_home_files register: baseline_second_disk_home_files
@ -128,13 +113,11 @@
changed_when: false changed_when: false
- name: Disk Partitions | AUDIT | Fail if /home is not mounted and not empty - name: Disk Partitions | AUDIT | Fail if /home is not mounted and not empty
become: true
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- ((baseline_second_disk_home_files.skipped is defined) and baseline_second_disk_home_files.skipped) or (baseline_second_disk_home_files.stdout == "") - ((baseline_second_disk_home_files.skipped is defined) and baseline_second_disk_home_files.skipped) or (baseline_second_disk_home_files.stdout == "")
- name: Disk Partitions | PATCH | Ensure /home is mounted - name: Disk Partitions | PATCH | Ensure /home is mounted
become: true
ansible.posix.mount: ansible.posix.mount:
src: "/dev/mapper/home_crypt" src: "/dev/mapper/home_crypt"
path: '/home' path: '/home'
@ -143,7 +126,6 @@
state: mounted state: mounted
- name: Disk Partitions | AUDIT | Check if /var is mounted - name: Disk Partitions | AUDIT | Check if /var is mounted
become: true
ansible.builtin.command: ansible.builtin.command:
cmd: mountpoint -q /var cmd: mountpoint -q /var
register: baseline_second_disk_var_mounted register: baseline_second_disk_var_mounted
@ -151,7 +133,6 @@
failed_when: false failed_when: false
- name: Disk Partitions | PATCH | Migrate content if /var is not mounted - name: Disk Partitions | PATCH | Migrate content if /var is not mounted
become: true
when: baseline_second_disk_var_mounted.rc != 0 when: baseline_second_disk_var_mounted.rc != 0
block: block:
- name: Disk Partitions | PATCH | Enter emergency mode - name: Disk Partitions | PATCH | Enter emergency mode

View file

@ -1,11 +1,9 @@
--- ---
- name: 'Disk Partitions | PATCH | Rename directory to directory.old | {{ baseline_second_disk_migrate_path }}' - name: 'Disk Partitions | PATCH | Rename directory to directory.old | {{ baseline_second_disk_migrate_path }}'
become: true
ansible.builtin.command: ansible.builtin.command:
cmd: 'mv {{ baseline_second_disk_migrate_path }} {{ baseline_second_disk_migrate_path }}.old' cmd: 'mv {{ baseline_second_disk_migrate_path }} {{ baseline_second_disk_migrate_path }}.old'
- name: 'Disk Partitions | PATCH | Mount {{ baseline_second_disk_migrate_path }}' - name: 'Disk Partitions | PATCH | Mount {{ baseline_second_disk_migrate_path }}'
become: true
ansible.posix.mount: ansible.posix.mount:
src: "/dev/mapper/datavg-{{ baseline_second_disk_migrate_path | replace('/', '', 1) | replace('/', '_') }}" src: "/dev/mapper/datavg-{{ baseline_second_disk_migrate_path | replace('/', '', 1) | replace('/', '_') }}"
path: '{{ baseline_second_disk_migrate_path }}' path: '{{ baseline_second_disk_migrate_path }}'
@ -15,7 +13,6 @@
# TODO: systemctl daemon-reload after modifying /etc/fstab # TODO: systemctl daemon-reload after modifying /etc/fstab
- name: 'Disk Partitions | PATCH | Set permissions | {{ baseline_second_disk_migrate_path }}' - name: 'Disk Partitions | PATCH | Set permissions | {{ baseline_second_disk_migrate_path }}'
become: true
ansible.builtin.file: ansible.builtin.file:
path: '{{ baseline_second_disk_migrate_path }}' path: '{{ baseline_second_disk_migrate_path }}'
owner: root owner: root
@ -24,13 +21,11 @@
state: directory state: directory
- name: 'Disk Partitions | PATCH | Move content | {{ baseline_second_disk_migrate_path }}' - name: 'Disk Partitions | PATCH | Move content | {{ baseline_second_disk_migrate_path }}'
become: true
ansible.builtin.shell: ansible.builtin.shell:
cmd: 'cp -ax * {{ baseline_second_disk_migrate_path }}/' cmd: 'cp -ax * {{ baseline_second_disk_migrate_path }}/'
chdir: '{{ baseline_second_disk_migrate_path }}.old' chdir: '{{ baseline_second_disk_migrate_path }}.old'
- name: 'Disk Partitions | PATCH | Delete directory.old | {{ baseline_second_disk_migrate_path }}' - name: 'Disk Partitions | PATCH | Delete directory.old | {{ baseline_second_disk_migrate_path }}'
become: true
ansible.builtin.file: ansible.builtin.file:
path: '{{ baseline_second_disk_migrate_path }}.old' path: '{{ baseline_second_disk_migrate_path }}.old'
state: absent state: absent

View file

@ -1,12 +1,10 @@
--- ---
- name: DNS Resolver | PATCH | Install systemd-resolved - name: DNS Resolver | PATCH | Install systemd-resolved
become: true
ansible.builtin.dnf: ansible.builtin.dnf:
name: systemd-resolved name: systemd-resolved
state: latest state: latest
- name: DNS Resolver | PATCH | Ensure systemd-resolved is in use - name: DNS Resolver | PATCH | Ensure systemd-resolved is in use
become: true
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: systemd-resolved name: systemd-resolved
state: started state: started
@ -14,14 +12,12 @@
masked: false masked: false
- name: DNS Resolver | PATCH | Remove loopback address entries containing the hostname from /etc/hosts - name: DNS Resolver | PATCH | Remove loopback address entries containing the hostname from /etc/hosts
become: true
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/hosts path: /etc/hosts
regexp: '^(127\.0\.0\.1|::1)\s.*{{ inventory_hostname }}' regexp: '^(127\.0\.0\.1|::1)\s.*{{ inventory_hostname }}'
state: absent state: absent
- name: DNS Resolver | PATCH | Enable DNSSEC and disable unwanted resolved features - name: DNS Resolver | PATCH | Enable DNSSEC and disable unwanted resolved features
become: true
ansible.builtin.copy: ansible.builtin.copy:
src: resolved.conf src: resolved.conf
dest: /etc/systemd/resolved.conf dest: /etc/systemd/resolved.conf
@ -29,9 +25,9 @@
group: root group: root
mode: "0644" mode: "0644"
notify: "Restart systemd-resolved" notify: "Restart systemd-resolved"
become: true
- name: DNS Resolver | PATCH | Ensure /etc/systemd/system/systemd-resolved.service.d exists - name: DNS Resolver | PATCH | Ensure /etc/systemd/system/systemd-resolved.service.d exists
become: true
ansible.builtin.file: ansible.builtin.file:
path: /etc/systemd/system/systemd-resolved.service.d path: /etc/systemd/system/systemd-resolved.service.d
state: directory state: directory
@ -40,7 +36,6 @@
mode: "0755" mode: "0755"
- name: DNS Resolver | PATCH | Disable resolved record synthesising - name: DNS Resolver | PATCH | Disable resolved record synthesising
become: true
ansible.builtin.copy: ansible.builtin.copy:
src: systemd-resolved-override.conf src: systemd-resolved-override.conf
dest: /etc/systemd/system/systemd-resolved.service.d/override.conf dest: /etc/systemd/system/systemd-resolved.service.d/override.conf
@ -48,3 +43,4 @@
group: root group: root
mode: "0644" mode: "0644"
notify: "Restart systemd-resolved" notify: "Restart systemd-resolved"
become: true

View file

@ -4,28 +4,21 @@
role: freeipa.ansible_freeipa.ipaclient role: freeipa.ansible_freeipa.ipaclient
vars: vars:
ipaclient_hostname: "{{ inventory_hostname }}" ipaclient_hostname: "{{ inventory_hostname }}"
when: ansible_user == "root" # We've already joined if we're using an unprivileged user
- name: FreeIPA Client | AUDIT | Check current authselect configuration - name: FreeIPA Client | AUDIT | Check current authselect configuration
become: true
ansible.builtin.command: authselect current ansible.builtin.command: authselect current
register: _baseline_freeipa_authselect_status register: _baseline_freeipa_authselect_status
changed_when: false changed_when: false
- name: FreeIPA Client | PATCH | Apply authselect profile with sssd, sudo, and more if not set - name: FreeIPA Client | PATCH | Apply authselect profile with sssd, sudo, and mkhomedir if not set
become: true ansible.builtin.command: authselect select sssd with-sudo with-mkhomedir with-subid --force
ansible.builtin.command: authselect select sssd with-sudo with-mkhomedir with-subid with-faillock with-pwhistory without-nullok --force
when: > when: >
'Profile ID: sssd' not in _baseline_freeipa_authselect_status.stdout or 'Profile ID: sssd' not in _baseline_freeipa_authselect_status.stdout or
'with-sudo' not in _baseline_freeipa_authselect_status.stdout or 'with-sudo' not in _baseline_freeipa_authselect_status.stdout or
'with-mkhomedir' not in _baseline_freeipa_authselect_status.stdout or 'with-mkhomedir' not in _baseline_freeipa_authselect_status.stdout or
'with-subid' not in _baseline_freeipa_authselect_status.stdout or 'with-subid' not in _baseline_freeipa_authselect_status.stdout
'with-faillock' not in _baseline_freeipa_authselect_status.stdout or
'with-pwhistory' not in _baseline_freeipa_authselect_status.stdout or
'without-nullok' not in _baseline_freeipa_authselect_status.stdout
- name: FreeIPA Client | PATCH | Enable oddjobd.service (for with-mkhomedir feature) - name: FreeIPA Client | PATCH | Enable oddjobd.service (for with-mkhomedir feature)
become: true
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: oddjobd.service name: oddjobd.service
state: started state: started

View file

@ -1,14 +1,13 @@
--- ---
- name: Lockdown | AUDIT | Check current authselect configuration - name: Lockdown | AUDIT | Check current authselect configuration
become: true
ansible.builtin.command: authselect current ansible.builtin.command: authselect current
register: baseline_lockdown_authselect_status register: baseline_lockdown_authselect_status
failed_when: false # Exit code is 2 when not configured failed_when: false # Exit code is 2 when not configured
changed_when: false changed_when: false
- name: Lockdown | PATCH | Run Ansible Lockdown (RHEL9-CIS) - name: Lockdown | PATCH | Run Ansible Lockdown (RHEL9-CIS)
ansible.builtin.import_role: ansible.builtin.include_role:
name: RHEL9-CIS # This is the SR2 fork that includes a patch to run all tasks with become: true name: RHEL9-CIS
vars: vars:
# Ensure message of the day is configured properly - we have our own MOTD to apply # Ensure message of the day is configured properly - we have our own MOTD to apply
rhel9cis_rule_1_7_1: false rhel9cis_rule_1_7_1: false
@ -17,7 +16,6 @@
rhel9cis_rule_5_1_7: false rhel9cis_rule_5_1_7: false
# Only disable root login once authselect is configured # Only disable root login once authselect is configured
rhel9cis_rule_5_1_20: "{{ baseline_lockdown_authselect_status.rc != 2 }}" rhel9cis_rule_5_1_20: "{{ baseline_lockdown_authselect_status.rc != 2 }}"
rhel9cis_rule_5_4_2_4: false # TODO: temporarily disable requirement for root password
# TODO: figure out boot password # TODO: figure out boot password
rhel9cis_set_boot_pass: false rhel9cis_set_boot_pass: false
# TODO: We intend to later deploy a remote rsyslog sink # TODO: We intend to later deploy a remote rsyslog sink

View file

@ -23,19 +23,16 @@
when: (baseline_epel_packages_allowed is defined) and (baseline_epel_packages_allowed | length > 0) when: (baseline_epel_packages_allowed is defined) and (baseline_epel_packages_allowed | length > 0)
block: block:
- name: Baseline | PATCH | Install epel-release - name: Baseline | PATCH | Install epel-release
become: true
ansible.builtin.dnf: ansible.builtin.dnf:
name: epel-release name: epel-release
state: present state: present
- name: Baseline | PATCH | Restrict packages to be installed from EPEL - name: Baseline | PATCH | Restrict packages to be installed from EPEL
become: true
community.general.ini_file: community.general.ini_file:
path: /etc/yum.repos.d/epel.repo path: /etc/yum.repos.d/epel.repo
section: epel section: epel
option: includepkgs option: includepkgs
value: "{{ baseline_epel_packages_allowed | join(',') }}" value: "{{ baseline_epel_packages_allowed | join(',') }}"
- name: Baseline | PATCH | Disable EPEL openh264 repository - name: Baseline | PATCH | Disable EPEL openh264 repository
become: true
community.general.ini_file: community.general.ini_file:
path: /etc/yum.repos.d/epel-cisco-openh264.repo path: /etc/yum.repos.d/epel-cisco-openh264.repo
section: epel-cisco-openh264 section: epel-cisco-openh264
@ -43,14 +40,12 @@
value: 0 value: 0
- name: Baseline | PATCH | Remove EPEL repository - name: Baseline | PATCH | Remove EPEL repository
become: true
ansible.builtin.dnf: ansible.builtin.dnf:
name: epel-release name: epel-release
state: absent state: absent
when: (baseline_epel_packages_allowed is not defined) or (baseline_epel_packages_allowed | length == 0) when: (baseline_epel_packages_allowed is not defined) or (baseline_epel_packages_allowed | length == 0)
- name: Baseline | PATCH | Remove cockpit-ws - name: Baseline | PATCH | Remove cockpit-ws
become: true
ansible.builtin.dnf: ansible.builtin.dnf:
name: cockpit-ws name: cockpit-ws
state: absent state: absent
@ -64,7 +59,6 @@
when: baseline_lockdown when: baseline_lockdown
- name: Baseline | PATCH | Ensure message of the day is configured properly (CIS 1.7.1, 1.7.4) - name: Baseline | PATCH | Ensure message of the day is configured properly (CIS 1.7.1, 1.7.4)
become: true
ansible.builtin.template: ansible.builtin.template:
src: motd.j2 src: motd.j2
dest: /etc/motd dest: /etc/motd
@ -73,7 +67,6 @@
mode: 'u-x,go-wx' mode: 'u-x,go-wx'
- name: Baseline | PATCH | Remove dhcpv6-client service from firewalld - name: Baseline | PATCH | Remove dhcpv6-client service from firewalld
become: true
ansible.posix.firewalld: ansible.posix.firewalld:
service: dhcpv6-client service: dhcpv6-client
state: disabled state: disabled
@ -82,7 +75,6 @@
zone: public zone: public
- name: Baseline | PATCH | Remove mdns service from firewalld - name: Baseline | PATCH | Remove mdns service from firewalld
become: true
ansible.posix.firewalld: ansible.posix.firewalld:
service: mdns service: mdns
state: disabled state: disabled
@ -91,7 +83,6 @@
zone: public zone: public
- name: Baseline | PATCH | Remove cockpit service from firewalld - name: Baseline | PATCH | Remove cockpit service from firewalld
become: true
ansible.posix.firewalld: ansible.posix.firewalld:
service: cockpit service: cockpit
state: disabled state: disabled

View file

@ -1,7 +1,6 @@
--- ---
# https://support.solusvm.com/hc/en-us/articles/21334950006807-How-to-install-Guest-Tools-manually-inside-a-VM-in-SolusVM-2 # https://support.solusvm.com/hc/en-us/articles/21334950006807-How-to-install-Guest-Tools-manually-inside-a-VM-in-SolusVM-2
- name: SolusVM Guest | PATCH | Install required packages - name: SolusVM Guest | PATCH | Install required packages
become: true
ansible.builtin.dnf: ansible.builtin.dnf:
name: name:
- qemu-guest-agent - qemu-guest-agent
@ -9,27 +8,27 @@
- tuned - tuned
state: latest state: latest
update_cache: true update_cache: true
become: true
- name: SolusVM Guest | PATCH | Enable and start tuned - name: SolusVM Guest | PATCH | Enable and start tuned
become: true
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: tuned name: tuned
enabled: true enabled: true
state: started state: started
become: true
- name: SolusVM Guest | AUDIT | Check for tuned profile - name: SolusVM Guest | AUDIT | Check for tuned profile
become: true
ansible.builtin.command: tuned-adm active ansible.builtin.command: tuned-adm active
register: _baseline_solusvm_tuned_profile register: _baseline_solusvm_tuned_profile
become: true
changed_when: false changed_when: false
- name: SolusVM Guest | PATCH | Start tuned profile (virtual-guest) - name: SolusVM Guest | PATCH | Start tuned profile (virtual-guest)
become: true
ansible.builtin.command: tuned-adm profile virtual-guest ansible.builtin.command: tuned-adm profile virtual-guest
become: true
when: "'virtual-guest' not in _baseline_solusvm_tuned_profile.stdout" when: "'virtual-guest' not in _baseline_solusvm_tuned_profile.stdout"
- name: SolusVM Guest | PATCH | Remove console=ttyS0,115200n8 from bootloader configurations - name: SolusVM Guest | PATCH | Remove console=ttyS0,115200n8 from bootloader configurations
become: true
ansible.builtin.replace: ansible.builtin.replace:
path: "{{ item }}" path: "{{ item }}"
regexp: 'console=ttyS0,115200n8' regexp: 'console=ttyS0,115200n8'
@ -42,14 +41,12 @@
- Regenerate grub config - Regenerate grub config
- name: SolusVM Guest | AUDIT | Find all vmlinuz-* files in /boot - name: SolusVM Guest | AUDIT | Find all vmlinuz-* files in /boot
become: true
ansible.builtin.find: ansible.builtin.find:
paths: /boot paths: /boot
patterns: 'vmlinuz-*' patterns: 'vmlinuz-*'
register: baseline_solusvm_kernels register: baseline_solusvm_kernels
- name: SolusVM Guest | PATCH | Remove console=ttyS0,115200n8 from existing kernel bootloader entries - name: SolusVM Guest | PATCH | Remove console=ttyS0,115200n8 from existing kernel bootloader entries
become: true
ansible.builtin.command: ansible.builtin.command:
cmd: "grubby --update-kernel={{ item.path }} --remove-args='console=ttyS0,115200n8'" cmd: "grubby --update-kernel={{ item.path }} --remove-args='console=ttyS0,115200n8'"
with_items: "{{ baseline_solusvm_kernels.files }}" with_items: "{{ baseline_solusvm_kernels.files }}"

View file

@ -38,14 +38,6 @@
become_user: "{{ item }}" become_user: "{{ item }}"
with_items: "{{ podman_host_rootless_users }}" with_items: "{{ podman_host_rootless_users }}"
- name: Podman Host | PATCH | Set XDG_RUNTIME_DIR in .bashrc for rootless users
ansible.builtin.lineinfile:
path: "/home/{{ item }}/.bashrc"
line: "export XDG_RUNTIME_DIR=/run/user/$(id -u)"
become: true
become_user: "{{ item }}"
with_items: "{{ podman_host_rootless_users }}"
- name: Podman Host | PATCH | Enable linger for rootless users - name: Podman Host | PATCH | Enable linger for rootless users
ansible.builtin.command: ansible.builtin.command:
argv: argv: