mirror of
https://github.com/dev-sec/ansible-collection-hardening
synced 2024-11-10 09:14:18 +00:00
bb588bd777
* linting Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * more linting Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * change line length issues Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * replace yes with true in tasks Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * use manual line-wrapping because ansible-lint does not support it correctly. see https://github.com/ansible/ansible-lint/issues/2522 * use manual line-wrapping because ansible-lint does not support it correctly. see https://github.com/ansible/ansible-lint/issues/2522 Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * use manual line-wrapping because ansible-lint does not support it correctly. see https://github.com/ansible/ansible-lint/issues/2522 Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * add exception for task Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * remove trailing whitespace * add back deleted params Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * add back deleted params Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com> * add back tasks Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
29 lines
879 B
YAML
29 lines
879 B
YAML
---
|
|
- name: Install modprobe to disable filesystems | os-10
|
|
ansible.builtin.package:
|
|
name: "{{ modprobe_package }}"
|
|
state: present
|
|
|
|
- name: Check if efi is installed
|
|
ansible.builtin.stat:
|
|
path: /sys/firmware/efi
|
|
register: efi_installed
|
|
|
|
- name: Remove vfat from fs-list if efi is used
|
|
ansible.builtin.set_fact:
|
|
os_unused_filesystems: "{{ os_unused_filesystems | difference('vfat') }}"
|
|
when:
|
|
- efi_installed.stat.isdir is defined
|
|
- efi_installed.stat.isdir
|
|
|
|
- name: Remove used filesystems from fs-list
|
|
ansible.builtin.set_fact:
|
|
os_unused_filesystems: "{{ os_unused_filesystems | difference(ansible_mounts | map(attribute='fstype') | list) }}"
|
|
|
|
- name: Disable unused filesystems | os-10
|
|
ansible.builtin.template:
|
|
src: etc/modprobe.d/modprobe.j2
|
|
dest: /etc/modprobe.d/dev-sec.conf
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|