ansible-bootstrap-rocky9/roles/rocky9/tasks/security_setup.yml
Alexander Kazantsev 96b524bed8 fix
2026-05-15 16:30:28 +03:00

22 lines
662 B
YAML

---
- name: Установка зависимостей SELinux
become: true
ansible.builtin.package:
name: "{{ (ansible_facts['distribution_major_version'] | int >= 8) | ternary('python3-libselinux', 'libselinux-python') }}"
state: present
- name: Disable SELinux
ansible.posix.selinux:
state: disabled
#- name: Explicitly specifying positional matched groups in replacement
# ansible.builtin.replace:
# path: /etc/ssh/sshd_config
# regexp: ^(ListenAddress[ ]+)[^\n]+$
# replace: \g<1>0.0.0.0
# - name: Disable Root Login
# template:
# src: permitrootlogin.conf.j2
# dest: /etc/ssh/sshd_config.d/01-permitrootlogin.conf