From 8b6d3bdb7f1b45b8ca452b18fe1581ccb9c7851d Mon Sep 17 00:00:00 2001 From: saibotk Date: Tue, 21 Sep 2021 04:59:32 +0200 Subject: [PATCH] traefik: Add option to disable SELinux related tasks --- roles/traefik/defaults/main.yml | 3 +++ roles/traefik/tasks/acmedumper.yml | 2 ++ roles/traefik/tasks/main.yml | 2 ++ roles/traefik/tasks/tor.yml | 2 ++ 4 files changed, 9 insertions(+) diff --git a/roles/traefik/defaults/main.yml b/roles/traefik/defaults/main.yml index 01cc5a0..c87f45e 100644 --- a/roles/traefik/defaults/main.yml +++ b/roles/traefik/defaults/main.yml @@ -121,6 +121,9 @@ traefik_acmedumper_image_version: "v{{ traefik_acmedumper_version }}" # The acmedumper output location traefik_acmedumper_location: "{{ traefik_install_location }}/certs" +# Enable or disable selinux handling +traefik_selinux_enabled: true + # The SELinux levels for tor/traefiks folders/container traefik_selinux_level: "{{ omit }}" traefik_tor_selinux_level: "{{ omit }}" diff --git a/roles/traefik/tasks/acmedumper.yml b/roles/traefik/tasks/acmedumper.yml index 2991488..6c4e53d 100644 --- a/roles/traefik/tasks/acmedumper.yml +++ b/roles/traefik/tasks/acmedumper.yml @@ -25,6 +25,8 @@ state: present with_items: - "{{ traefik_acmedumper_location }}" + when: + - traefik_selinux_enabled become: true - name: Create data directory for acme-dumper diff --git a/roles/traefik/tasks/main.yml b/roles/traefik/tasks/main.yml index 4af5382..74bd65f 100644 --- a/roles/traefik/tasks/main.yml +++ b/roles/traefik/tasks/main.yml @@ -28,6 +28,8 @@ with_items: - "{{ traefik_acme_location }}" - "{{ traefik_config_location }}" + when: + - traefik_selinux_enabled become: true - name: Create install directory diff --git a/roles/traefik/tasks/tor.yml b/roles/traefik/tasks/tor.yml index a535927..0b42d9f 100644 --- a/roles/traefik/tasks/tor.yml +++ b/roles/traefik/tasks/tor.yml @@ -27,6 +27,8 @@ with_items: - "{{ traefik_tor_data_location }}" - "{{ traefik_tor_config_location }}" + when: + - traefik_selinux_enabled become: true - name: Create install directory