Skip to content

Rhel10 and SELinux compatibility #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Core dependency for Paramiko connection type in Ansible
# Install using: pip install -r requirements.txt
paramiko>=2.11.0
12 changes: 12 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Install using: ansible-galaxy collection install -r requirements.yml
collections:
# For the sefcontext module (used for SELinux context management)
- name: ansible.posix
version: ">=2.0.0"
# For ini_file and slack modules
- name: community.general
version: ">=3.0.0"
# Most other modules (stat, command, include_tasks, debug, file, unarchive, template, git, etc.)
# are part of ansible-core and require no additional collection.

8 changes: 8 additions & 0 deletions roles/splunk/tasks/download_and_unarchive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
notify:
- start splunk

- name: "Restore SELinux contexts on Splunk directory"
become: true
command: "restorecon -Rv {{ splunk_home }}"
when:
- ansible_facts['os_family'] == "RedHat"
- ansible_facts['selinux']['status'] == "enabled"
- ansible_facts['selinux']['mode'] == "enforcing"

- name: "Remove {{ splunk_package_path }}/{{ splunk_file }} package"
become: true
ansible.builtin.file:
Expand Down
2 changes: 1 addition & 1 deletion roles/splunk/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"

- name: Include prerequisites
Expand Down
21 changes: 21 additions & 0 deletions roles/splunk/vars/RedHat10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
global_bashrc: /etc/bashrc
chk_config_cmd: chkconfig --add disable-thp
linux_packages:
- nload
- iotop
- iftop
- sysstat
- telnet
- tcpdump
- htop
- atop
- lsof
- policycoreutils-python-utils
- policycoreutils
- setroubleshoot
- nethogs
- gdb
- bind-utils
firewall_service: firewalld
logrotate_file: /etc/logrotate.d/rsyslog