From b78d07d82493a85d8785bb15eb9ff5055bbafe84 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Mon, 23 Mar 2020 19:56:09 +0100 Subject: [PATCH] 4.1.0.0 https://haproxy-wi.org/changelog.py#4_1 --- .../ansible/roles/haproxy/tasks/main.yml | 4 ++- .../roles/haproxy/templates/selinux.j2 | 11 ++++++ .../roles/keepalived/tasks/install.yml | 4 ++- app/scripts/ansible/roles/nginx.yml | 8 ++--- app/templates/base.html | 34 +++++++++---------- 5 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 app/scripts/ansible/roles/haproxy/templates/selinux.j2 diff --git a/app/scripts/ansible/roles/haproxy/tasks/main.yml b/app/scripts/ansible/roles/haproxy/tasks/main.yml index 9d0bb241..74649ce4 100644 --- a/app/scripts/ansible/roles/haproxy/tasks/main.yml +++ b/app/scripts/ansible/roles/haproxy/tasks/main.yml @@ -76,7 +76,9 @@ - name: Disble SELINUX in config - shell: sed -i 's\SELINUX=enforcing\SELINUX=permissive\' /etc/selinux/config + template: + src: selinux.j2 + dest: /etc/selinux/config - name: Disble SELINUX in env diff --git a/app/scripts/ansible/roles/haproxy/templates/selinux.j2 b/app/scripts/ansible/roles/haproxy/templates/selinux.j2 new file mode 100644 index 00000000..296418a6 --- /dev/null +++ b/app/scripts/ansible/roles/haproxy/templates/selinux.j2 @@ -0,0 +1,11 @@ +# This file controls the state of SELinux on the system. +# SELINUX= can take one of these three values: +# enforcing - SELinux security policy is enforced. +# permissive - SELinux prints warnings instead of enforcing. +# disabled - No SELinux policy is loaded. +SELINUX=permissive +# SELINUXTYPE= can take one of three two values: +# targeted - Targeted processes are protected, +# minimum - Modification of targeted policy. Only selected processes are protected. +# mls - Multi Level Security protection. +SELINUXTYPE=targeted \ No newline at end of file diff --git a/app/scripts/ansible/roles/keepalived/tasks/install.yml b/app/scripts/ansible/roles/keepalived/tasks/install.yml index a83b5211..4d4736f0 100644 --- a/app/scripts/ansible/roles/keepalived/tasks/install.yml +++ b/app/scripts/ansible/roles/keepalived/tasks/install.yml @@ -56,7 +56,9 @@ - name: Disble SELINUX in config - shell: sed -i 's\SELINUX=enforcing\SELINUX=permissive\' /etc/selinux/config + template: + src: ../../haproxy/templates/selinux.j2 + dest: /etc/selinux/config - name: Disble SELINUX in env diff --git a/app/scripts/ansible/roles/nginx.yml b/app/scripts/ansible/roles/nginx.yml index 9fbf2450..5550160d 100644 --- a/app/scripts/ansible/roles/nginx.yml +++ b/app/scripts/ansible/roles/nginx.yml @@ -46,11 +46,11 @@ name: "{{STATS_USER}}" password: "{{STATS_PASS}}" when: "'nginx' not in ansible_facts.packages" - - + - name: Disble SELINUX in config - shell: sed -i 's\SELINUX=enforcing\SELINUX=permissive\' /etc/selinux/config - + template: + src: /var/www/haproxy-wi/app/scripts/ansible/roles/haproxy/templates/selinux.j2 + dest: /etc/selinux/config - name: Disble SELINUX in env shell: setenforce 0 diff --git a/app/templates/base.html b/app/templates/base.html index a47653ba..bba65023 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -235,23 +235,23 @@
{% if versions is defined %} - {% set current_ver = versions.0 %} - {% set new_ver = versions.1 %} - {% set current_ver_without_dots = versions.2 %} - {% set new_ver_without_dots = versions.3 %} - {% endif %} - {% if new_ver_without_dots is defined and current_ver_without_dots is defined and new_ver is defined and new_ver_without_dots is defined %} - - {% if new_ver > current_ver and new_ver != "Sorry cannot get current version" %} - v{{current_ver}} - {% else %} - v{{current_ver}} - {% endif %} - - {% else %} - v{{current_ver}} - {% endif %} -
+ {% set current_ver = versions.0 %} + {% set new_ver = versions.1 %} + {% set current_ver_without_dots = versions.2 %} + {% set new_ver_without_dots = versions.3 %} + {% endif %} + {% if new_ver_without_dots is defined and current_ver_without_dots is defined and new_ver is defined and new_ver_without_dots is defined %} + + {% if new_ver_without_dots > current_ver_without_dots and new_ver != "Sorry cannot get current version" %} + v{{current_ver}} + {% else %} + v{{current_ver}} + {% endif %} + + {% else %} + v{{current_ver}} + {% endif %} +