From bcc492339f8f030d6a37d0d9dd05d4e1fc4534f8 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Thu, 11 Mar 2021 15:38:49 +0100 Subject: [PATCH 01/10] Add master Rives VM --- hosts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts b/hosts index 4191852..c7564c2 100644 --- a/hosts +++ b/hosts @@ -355,6 +355,10 @@ radius-rives-backup.adm.auro.re routeur-rives-backup.adm.auro.re ldap-replica-rives.adm.auro.re prometheus-rives.adm.auro.re +dhcp-rives.adm.auro.re +dns-rives.adm.auro.re +radius-rives.adm.auro.re +routeur-rives.auro.re [rives_unifi] r3-4-4.borne.auro.re From f6e1949c213e40a8a66b2e1ea692645a10910447 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Fri, 12 Mar 2021 12:28:08 +0100 Subject: [PATCH 02/10] Adding master VM for Rives and adapt radius role for bullseye --- hosts | 2 +- roles/prometheus_node/tasks/main.yml | 3 +- roles/radius/tasks/main.yml | 51 ++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/hosts b/hosts index c7564c2..4d1c1a2 100644 --- a/hosts +++ b/hosts @@ -358,7 +358,7 @@ prometheus-rives.adm.auro.re dhcp-rives.adm.auro.re dns-rives.adm.auro.re radius-rives.adm.auro.re -routeur-rives.auro.re +routeur-rives.adm.auro.re [rives_unifi] r3-4-4.borne.auro.re diff --git a/roles/prometheus_node/tasks/main.yml b/roles/prometheus_node/tasks/main.yml index 7ca6350..19cb5a0 100644 --- a/roles/prometheus_node/tasks/main.yml +++ b/roles/prometheus_node/tasks/main.yml @@ -7,8 +7,7 @@ register: apt_result retries: 3 until: apt_result is succeeded - when: - - ansible_lsb.codename == 'buster' + when: ansible_lsb.codename == 'buster' or ansible_lsb.codename == 'bullseye' # Prometheus 2 node is in stretch-backports - name: Install Prometheus node-exporter (stretch-backports) diff --git a/roles/radius/tasks/main.yml b/roles/radius/tasks/main.yml index 303a86f..37a5212 100644 --- a/roles/radius/tasks/main.yml +++ b/roles/radius/tasks/main.yml @@ -5,6 +5,17 @@ loop: - "deb" - "deb-src" + when: + - ansible_lsb.codename == 'buster' + +- name: Add backports repositories + apt_repository: + repo: "{{ item }} http://deb.debian.org/debian bullseye main contrib non-free" + loop: + - "deb" + - "deb-src" + when: + - ansible_lsb.codename == 'bullseye' - name: Ensure /var/www exists file: @@ -34,7 +45,6 @@ - name: try to install freeradius-python3 (this will fail on post-install) apt: name: freeradius-python3 - default_release: buster-backports update_cache: true ignore_errors: true @@ -47,7 +57,6 @@ - name: reinstall broken package (this might fail too, for different reasons) apt: name: freeradius-python3 - default_release: buster-backports force: true ignore_errors: true @@ -108,6 +117,44 @@ shell: cmd: "cat apt_requirements_radius.txt | grep -v freeradius-python3 | xargs apt-get -y install" chdir: /var/www/re2o/ + when: + - ansible_lsb.codename == 'buster' + +- name: Install radius requirements (except freeradius-python3) for bullseye + apt: + name: + - python3-django + - python3-dateutil + - texlive-latex-base + - texlive-fonts-recommended + - python3-djangorestframework + - python3-django-reversion + - python3-pip + - python3-pil + - libsasl2-dev + - libldap2-dev + - libssl-dev + - python3-pycryptodome + - python3-git + - javascript-common + - libjs-jquery + - libjs-jquery-ui + - libjs-jquery-timepicker + - libjs-bootstrap + - fonts-font-awesome + - graphviz + - git + - gettext + - libfreeradius3 + - freeradius-utils + - freeradius + - freeradius-common + - freeradius-python3 + - python3-dev + - python3-mysqldb + - python3-django-ldapdb + when: + - ansible_lsb.codename == 'bullseye' - name: Install PyPi requirements for radius command: "pip3 install -r /var/www/re2o/pip_requirements.txt" From f662e4bd47cd21d60a289c731153b98747cd7295 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Tue, 16 Mar 2021 21:13:45 +0100 Subject: [PATCH 03/10] Remove bullseye for radius role. Add the oid for temperature of ups --- .../templates/prometheus/snmp.yml.j2 | 7 ++- roles/radius/tasks/main.yml | 53 +++---------------- 2 files changed, 11 insertions(+), 49 deletions(-) diff --git a/roles/prometheus/templates/prometheus/snmp.yml.j2 b/roles/prometheus/templates/prometheus/snmp.yml.j2 index 7f543db..cd8abd0 100644 --- a/roles/prometheus/templates/prometheus/snmp.yml.j2 +++ b/roles/prometheus/templates/prometheus/snmp.yml.j2 @@ -69,10 +69,13 @@ eatonups: - labelname: upsOutputLineIndex type: gauge - name: xupsEnvRemoteTemp -# oid: 1.3.6.1.4.1.534.1.6.5 oid: 1.3.6.1.4.1.318.1.1.10.2.3.2.1.4 type: gauge - help: The reading of an EMP's temperature sensor. - 1.3.6.1.4.1.318.1.1.10.2.3.2.1.4 + help: The reading of an EMP's temperature sensor (APC MIB) - 1.3.6.1.4.1.318.1.1.10.2.3.2.1.4 + - name: xupsEnvRemoteTemp + oid: 1.3.6.1.4.1.534.1.6.5 + type: gauge + help: The reading of an EMP's temperature sensor (Eaton MIB) - 1.3.6.1.4.1.534.1.6.5 - name: xupsEnvRemoteHumidity oid: 1.3.6.1.4.1.534.1.6.6 type: gauge diff --git a/roles/radius/tasks/main.yml b/roles/radius/tasks/main.yml index 37a5212..c9c2fe8 100644 --- a/roles/radius/tasks/main.yml +++ b/roles/radius/tasks/main.yml @@ -8,15 +8,6 @@ when: - ansible_lsb.codename == 'buster' -- name: Add backports repositories - apt_repository: - repo: "{{ item }} http://deb.debian.org/debian bullseye main contrib non-free" - loop: - - "deb" - - "deb-src" - when: - - ansible_lsb.codename == 'bullseye' - - name: Ensure /var/www exists file: name: "/var/www" @@ -117,44 +108,6 @@ shell: cmd: "cat apt_requirements_radius.txt | grep -v freeradius-python3 | xargs apt-get -y install" chdir: /var/www/re2o/ - when: - - ansible_lsb.codename == 'buster' - -- name: Install radius requirements (except freeradius-python3) for bullseye - apt: - name: - - python3-django - - python3-dateutil - - texlive-latex-base - - texlive-fonts-recommended - - python3-djangorestframework - - python3-django-reversion - - python3-pip - - python3-pil - - libsasl2-dev - - libldap2-dev - - libssl-dev - - python3-pycryptodome - - python3-git - - javascript-common - - libjs-jquery - - libjs-jquery-ui - - libjs-jquery-timepicker - - libjs-bootstrap - - fonts-font-awesome - - graphviz - - git - - gettext - - libfreeradius3 - - freeradius-utils - - freeradius - - freeradius-common - - freeradius-python3 - - python3-dev - - python3-mysqldb - - python3-django-ldapdb - when: - - ansible_lsb.codename == 'bullseye' - name: Install PyPi requirements for radius command: "pip3 install -r /var/www/re2o/pip_requirements.txt" @@ -300,6 +253,12 @@ - re2o_pub become_user: postgres +- name: Install freeradius re2o with Python3.X + template: + src: python_re2o.j2 + dest: /etc/freeradius/3.0/mods-enabled/python + mode: 0640 + owner: freerad - name: Restart freeradius, ensure enabled systemd: From ffbedf6d356b793ddde241bcdb15221fc0ad113a Mon Sep 17 00:00:00 2001 From: pz2891 Date: Tue, 16 Mar 2021 21:34:41 +0100 Subject: [PATCH 04/10] Add new Bornes of EDC --- hosts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts b/hosts index 4d1c1a2..4e80eb3 100644 --- a/hosts +++ b/hosts @@ -269,8 +269,12 @@ ep-1-1.borne.auro.re ep-1-3.borne.auro.re ep-1-2.borne.auro.re ep-0-1.borne.auro.re +eo-0-1.borne.auro.re eo-2-1.borne.auro.re +eo-2-2.borne.auro.re ee-2-1.borne.auro.re +ee-2-2.borne.auro.re + ############################################################################### # George Sand From a1533b7efde043a3f62a79c53ae2816513130ce4 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Wed, 17 Mar 2021 20:41:46 +0100 Subject: [PATCH 05/10] Fix issues for installing radius-rives (baq package for postgresql-client) --- nuke_radius_dbs.yml | 7 +++++++ roles/radius/tasks/main.yml | 13 ++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100755 nuke_radius_dbs.yml diff --git a/nuke_radius_dbs.yml b/nuke_radius_dbs.yml new file mode 100755 index 0000000..4af58c2 --- /dev/null +++ b/nuke_radius_dbs.yml @@ -0,0 +1,7 @@ +#!/usr/bin/env ansible-playbook +--- +- hosts: radius-*.adm.auro.re + roles: + - radius + vars: + nuke_radius: true diff --git a/roles/radius/tasks/main.yml b/roles/radius/tasks/main.yml index c9c2fe8..e79d742 100644 --- a/roles/radius/tasks/main.yml +++ b/roles/radius/tasks/main.yml @@ -5,8 +5,6 @@ loop: - "deb" - "deb-src" - when: - - ansible_lsb.codename == 'buster' - name: Ensure /var/www exists file: @@ -36,6 +34,7 @@ - name: try to install freeradius-python3 (this will fail on post-install) apt: name: freeradius-python3 + default_release: buster-backports update_cache: true ignore_errors: true @@ -48,6 +47,7 @@ - name: reinstall broken package (this might fail too, for different reasons) apt: name: freeradius-python3 + default_release: buster-backports force: true ignore_errors: true @@ -128,7 +128,8 @@ apt: name: - postgresql - - postgresql-client + - postgresql-client-11=11.7-0+deb10u1 + force: yes - name: Install postgresql ansible module requirement(s) pip: @@ -253,12 +254,6 @@ - re2o_pub become_user: postgres -- name: Install freeradius re2o with Python3.X - template: - src: python_re2o.j2 - dest: /etc/freeradius/3.0/mods-enabled/python - mode: 0640 - owner: freerad - name: Restart freeradius, ensure enabled systemd: From 465ab398c0a2f8cbf7108e973c463342f2087248 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Wed, 17 Mar 2021 20:43:55 +0100 Subject: [PATCH 06/10] remove file (copied from utils) --- nuke_radius_dbs.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100755 nuke_radius_dbs.yml diff --git a/nuke_radius_dbs.yml b/nuke_radius_dbs.yml deleted file mode 100755 index 4af58c2..0000000 --- a/nuke_radius_dbs.yml +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env ansible-playbook ---- -- hosts: radius-*.adm.auro.re - roles: - - radius - vars: - nuke_radius: true From cccd9ac59890a9849694cedce615bf241ac10292 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Thu, 11 Mar 2021 15:38:49 +0100 Subject: [PATCH 07/10] Add master Rives VM --- hosts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts b/hosts index f3ec2af..c46146d 100644 --- a/hosts +++ b/hosts @@ -358,6 +358,10 @@ radius-rives-backup.adm.auro.re routeur-rives-backup.adm.auro.re ldap-replica-rives.adm.auro.re prometheus-rives.adm.auro.re +dhcp-rives.adm.auro.re +dns-rives.adm.auro.re +radius-rives.adm.auro.re +routeur-rives.auro.re [rives_unifi] r3-4-4.borne.auro.re From 3de76b0ac77aff134199cd340a337e0243f878b8 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Tue, 16 Mar 2021 21:34:41 +0100 Subject: [PATCH 08/10] Add new Bornes of EDC --- hosts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts b/hosts index c46146d..2ed70f5 100644 --- a/hosts +++ b/hosts @@ -272,8 +272,12 @@ ep-1-1.borne.auro.re ep-1-3.borne.auro.re ep-1-2.borne.auro.re ep-0-1.borne.auro.re +eo-0-1.borne.auro.re eo-2-1.borne.auro.re +eo-2-2.borne.auro.re ee-2-1.borne.auro.re +ee-2-2.borne.auro.re + ############################################################################### # George Sand From 2952c39f70df6a66f418fc5eed227e1dd81ec1e9 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Wed, 17 Mar 2021 20:41:46 +0100 Subject: [PATCH 09/10] Fix issues for installing radius-rives (baq package for postgresql-client) --- nuke_radius_dbs.yml | 7 +++++++ roles/radius/tasks/main.yml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 nuke_radius_dbs.yml diff --git a/nuke_radius_dbs.yml b/nuke_radius_dbs.yml new file mode 100755 index 0000000..4af58c2 --- /dev/null +++ b/nuke_radius_dbs.yml @@ -0,0 +1,7 @@ +#!/usr/bin/env ansible-playbook +--- +- hosts: radius-*.adm.auro.re + roles: + - radius + vars: + nuke_radius: true diff --git a/roles/radius/tasks/main.yml b/roles/radius/tasks/main.yml index 303a86f..e79d742 100644 --- a/roles/radius/tasks/main.yml +++ b/roles/radius/tasks/main.yml @@ -128,7 +128,8 @@ apt: name: - postgresql - - postgresql-client + - postgresql-client-11=11.7-0+deb10u1 + force: yes - name: Install postgresql ansible module requirement(s) pip: From cec907af481f35e286f88e8935be59fe67d6db82 Mon Sep 17 00:00:00 2001 From: pz2891 Date: Wed, 17 Mar 2021 20:43:55 +0100 Subject: [PATCH 10/10] remove file (copied from utils) --- nuke_radius_dbs.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100755 nuke_radius_dbs.yml diff --git a/nuke_radius_dbs.yml b/nuke_radius_dbs.yml deleted file mode 100755 index 4af58c2..0000000 --- a/nuke_radius_dbs.yml +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env ansible-playbook ---- -- hosts: radius-*.adm.auro.re - roles: - - radius - vars: - nuke_radius: true