From e2c1ebe249834cc27778c5668385a46c0cc1e4a1 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Tue, 17 Mar 2020 19:20:59 +0100 Subject: [PATCH] 4.1.0.0 https://haproxy-wi.org/changelog.py#4_1 --- app/create_db.py | 2 +- .../ansible/roles/haproxy/tasks/main.yml | 8 ++ .../roles/keepalived/tasks/install.yml | 8 ++ app/scripts/ansible/roles/nginx.yml | 9 ++ app/templates/ajax/nginx_stats.html | 126 ++++++++++++++++++ app/templates/base.html | 1 + app/templates/hapservers.html | 26 ++-- app/templates/servers.html | 4 +- app/templates/viewstats.html | 1 + inc/script.js | 9 ++ 10 files changed, 180 insertions(+), 14 deletions(-) create mode 100644 app/templates/ajax/nginx_stats.html diff --git a/app/create_db.py b/app/create_db.py index 61419459..5a7f4845 100644 --- a/app/create_db.py +++ b/app/create_db.py @@ -432,7 +432,7 @@ def update_db_v_42(**kwargs): def update_ver(**kwargs): con, cur = get_cur() - sql = """update version set version = '4.0.0.0'; """ + sql = """update version set version = '4.1.0.0'; """ try: cur.execute(sql) con.commit() diff --git a/app/scripts/ansible/roles/haproxy/tasks/main.yml b/app/scripts/ansible/roles/haproxy/tasks/main.yml index 7210cde9..5e25df8f 100644 --- a/app/scripts/ansible/roles/haproxy/tasks/main.yml +++ b/app/scripts/ansible/roles/haproxy/tasks/main.yml @@ -75,6 +75,14 @@ when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS') and haproxy_from_wi is defined +- name: Disble SELINUX in config + shell: sed -i 's\SELINUX=enforcing\SELINUX=permissive\' /etc/selinux/config + + +- name: Disble SELINUX in env + shell: setenforce 0 + + - name: Enable and start service HAProxy systemd: name: haproxy diff --git a/app/scripts/ansible/roles/keepalived/tasks/install.yml b/app/scripts/ansible/roles/keepalived/tasks/install.yml index c27499b0..a83b5211 100644 --- a/app/scripts/ansible/roles/keepalived/tasks/install.yml +++ b/app/scripts/ansible/roles/keepalived/tasks/install.yml @@ -55,6 +55,14 @@ notify: restart keepalived +- name: Disble SELINUX in config + shell: sed -i 's\SELINUX=enforcing\SELINUX=permissive\' /etc/selinux/config + + +- name: Disble SELINUX in env + shell: setenforce 0 + + - name: Enable and start service keepalived service: name: keepalived diff --git a/app/scripts/ansible/roles/nginx.yml b/app/scripts/ansible/roles/nginx.yml index 89da7ddb..9fbf2450 100644 --- a/app/scripts/ansible/roles/nginx.yml +++ b/app/scripts/ansible/roles/nginx.yml @@ -47,6 +47,15 @@ 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 + + + - name: Disble SELINUX in env + shell: setenforce 0 + + - hosts: "{{ variable_host }}" become: yes become_method: sudo diff --git a/app/templates/ajax/nginx_stats.html b/app/templates/ajax/nginx_stats.html new file mode 100644 index 00000000..9cb33370 --- /dev/null +++ b/app/templates/ajax/nginx_stats.html @@ -0,0 +1,126 @@ + + + + {% for l in out %} + + + + + +
+ + Nginx status +
+ + + + + + + + + + + + + + + + + + + + +
+ {{l.0.0}} {{l.0.1}} + + {{l.0.4}} + + {{l.0.5}} + + {{l.0.6}} + + {{l.0.10}} + + {{l.0.12}} + + {{l.0.14}} +
+ {{l.0.2}} + + {{l.0.7}} + + {{l.0.8}} + + {{l.0.9}} + + {{l.0.11}} + + {{l.0.13}} + + {{l.0.15}} +
+
+ You can read the description about statuses here +
+ {% endfor %} diff --git a/app/templates/base.html b/app/templates/base.html index c4cdda80..a47653ba 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -76,6 +76,7 @@ diff --git a/app/templates/hapservers.html b/app/templates/hapservers.html index a9e211ca..106e81ed 100644 --- a/app/templates/hapservers.html +++ b/app/templates/hapservers.html @@ -37,10 +37,12 @@