2020-10-01 12:35:29 +02:00
|
|
|
---
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Check the selinux context of the git repo directory
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: matchpathcon /srv/git
|
2020-10-01 12:35:29 +02:00
|
|
|
register: distgitcontext
|
|
|
|
|
check_mode: no
|
|
|
|
|
changed_when: false
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
|
|
|
|
- selinux
|
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Show the output of distgitcontext
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.builtin.debug:
|
2020-11-09 16:22:10 +01:00
|
|
|
var: distgitcontext.stdout
|
2020-11-05 17:05:27 +01:00
|
|
|
tags:
|
|
|
|
|
- selinux
|
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Show if we find gitosis_var_lib_t in distgitcontext
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.builtin.debug:
|
2020-11-09 16:22:10 +01:00
|
|
|
var: distgitcontext.stdout.find('gitosis_var_lib_t')
|
2020-11-05 17:05:27 +01:00
|
|
|
tags:
|
|
|
|
|
- selinux
|
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Set the SELinux policy for the distgit root directory
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: semanage fcontext -a -t gitosis_var_lib_t "/srv/git(/.*)?"
|
2020-10-01 12:35:29 +02:00
|
|
|
when: distgitcontext.stdout.find('gitosis_var_lib_t') == -1
|
2025-04-30 11:57:57 +02:00
|
|
|
changed_when: false
|
2020-10-01 12:35:29 +02:00
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
|
|
|
|
- selinux
|
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Check the selinux context of the releases directory
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: matchpathcon /var/www/releases
|
2020-10-01 12:35:29 +02:00
|
|
|
register: distgitcontext
|
|
|
|
|
check_mode: no
|
|
|
|
|
changed_when: false
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
|
|
|
|
- selinux
|
|
|
|
|
|
|
|
|
|
# Note: On Fedora its httpd_sys_content_rw_t - Don't we love confusions?
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Set the SELinux policy for the releases directory
|
2024-12-19 11:22:24 +10:00
|
|
|
ansible.builtin.command: semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/releases(/.*)?"
|
2020-10-01 12:35:29 +02:00
|
|
|
when: distgitcontext.stdout.find('httpd_sys_rw_content_t') == -1
|
2025-04-30 11:57:57 +02:00
|
|
|
changed_when: false
|
2020-10-01 12:35:29 +02:00
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
|
|
|
|
- selinux
|
|
|
|
|
|
2020-11-10 15:55:10 +01:00
|
|
|
- name: Install the pagure SELinux policy
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.builtin.include_role:
|
2020-11-10 15:55:10 +01:00
|
|
|
name: selinux/module
|
|
|
|
|
vars:
|
2020-11-10 15:59:32 +01:00
|
|
|
policy_file: files/selinux/pagure.te
|
2020-11-10 15:55:10 +01:00
|
|
|
policy_name: pagure
|
2020-10-01 12:35:29 +02:00
|
|
|
tags:
|
2020-11-10 15:55:10 +01:00
|
|
|
- selinux
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
2020-10-01 12:35:29 +02:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Set sebooleans so pagure can talk to the network (db + redis)
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.posix.seboolean:
|
|
|
|
|
name: httpd_can_network_connect
|
|
|
|
|
state: true
|
|
|
|
|
persistent: true
|
2020-10-01 12:35:29 +02:00
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Set sebooleans so apache can send emails
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.posix.seboolean:
|
|
|
|
|
name: httpd_can_sendmail
|
|
|
|
|
state: true
|
|
|
|
|
persistent: true
|
2020-10-01 12:35:29 +02:00
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Set sebooleans so pygit2 can read the git repos
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.posix.seboolean:
|
|
|
|
|
name: httpd_execmem
|
|
|
|
|
state: true
|
|
|
|
|
persistent: true
|
2020-10-01 12:35:29 +02:00
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Set sebooleans so ssh can retrieve access info from apache
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.posix.seboolean:
|
|
|
|
|
name: nis_enabled
|
|
|
|
|
state: true
|
|
|
|
|
persistent: true
|
2020-10-01 12:35:29 +02:00
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|
2026-07-01 13:25:24 +01:00
|
|
|
- name: Set sebooleans to deny nagios/nrpe to call sudo as it's gone
|
2025-04-30 11:57:57 +02:00
|
|
|
ansible.posix.seboolean:
|
|
|
|
|
name: nagios_run_sudo
|
2026-07-01 13:25:24 +01:00
|
|
|
state: false
|
2025-04-30 11:57:57 +02:00
|
|
|
persistent: true
|
2021-06-08 02:02:00 +02:00
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|