2020-10-01 12:35:29 +02:00
|
|
|
---
|
|
|
|
|
- name: check the selinux context of the git repo directory
|
|
|
|
|
command: matchpathcon /srv/git
|
|
|
|
|
register: distgitcontext
|
|
|
|
|
check_mode: no
|
|
|
|
|
changed_when: false
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
|
|
|
|
- selinux
|
|
|
|
|
|
2020-11-05 17:19:42 +01:00
|
|
|
- name: show the output of distgitcontext
|
|
|
|
|
debug:
|
2020-11-09 16:22:10 +01:00
|
|
|
var: distgitcontext.stdout
|
2020-11-05 17:05:27 +01:00
|
|
|
tags:
|
|
|
|
|
- selinux
|
|
|
|
|
|
2020-11-05 17:19:42 +01:00
|
|
|
- name: show if we find gitosis_var_lib_t in distgitcontext
|
|
|
|
|
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
|
|
|
|
|
|
2020-10-01 12:35:29 +02:00
|
|
|
- name: set the SELinux policy for the distgit root directory
|
|
|
|
|
command: semanage fcontext -a -t gitosis_var_lib_t "/srv/git(/.*)?"
|
|
|
|
|
when: distgitcontext.stdout.find('gitosis_var_lib_t') == -1
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
|
|
|
|
- selinux
|
|
|
|
|
|
|
|
|
|
- name: check the selinux context of the releases directory
|
|
|
|
|
command: matchpathcon /var/www/releases
|
|
|
|
|
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?
|
|
|
|
|
- name: set the SELinux policy for the releases directory
|
|
|
|
|
command: semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/releases(/.*)?"
|
|
|
|
|
when: distgitcontext.stdout.find('httpd_sys_rw_content_t') == -1
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- pagure
|
|
|
|
|
- selinux
|
|
|
|
|
|
2020-11-10 15:55:10 +01:00
|
|
|
- name: Install the pagure SELinux policy
|
|
|
|
|
run_once: true
|
|
|
|
|
include_role:
|
|
|
|
|
name: selinux/module
|
|
|
|
|
vars:
|
|
|
|
|
policy_file: files/pagure.te
|
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: set sebooleans so pagure can talk to the network (db + redis)
|
|
|
|
|
seboolean: name=httpd_can_network_connect
|
|
|
|
|
state=true
|
|
|
|
|
persistent=true
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|
|
|
|
|
- name: set sebooleans so apache can send emails
|
|
|
|
|
seboolean: name=httpd_can_sendmail
|
|
|
|
|
state=true
|
|
|
|
|
persistent=true
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|
|
|
|
|
- name: set sebooleans so pygit2 can read the git repos
|
|
|
|
|
seboolean: name=httpd_execmem
|
|
|
|
|
state=true
|
|
|
|
|
persistent=true
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|
|
|
|
|
- name: set sebooleans so ssh can retrieve access info from apache
|
2020-10-01 12:44:33 +02:00
|
|
|
seboolean: name=nis_enabled
|
2020-10-01 12:35:29 +02:00
|
|
|
state=true
|
|
|
|
|
persistent=true
|
|
|
|
|
tags:
|
|
|
|
|
- config
|
|
|
|
|
- selinux
|
|
|
|
|
- pagure
|
|
|
|
|
|