Ansible adaptions

This commit is contained in:
Dirk Alders 2024-03-24 13:19:07 +01:00
parent 59b312ae7a
commit 51c0b9eaa9
3 changed files with 25 additions and 9 deletions

View File

@ -5,9 +5,9 @@ LOGLEVEL = logging.INFO
APP_NAME = "z_monitor" APP_NAME = "z_monitor"
MQTT_SERVER = "<hostname>" MQTT_SERVER = "{{ server_nagios_hostname }}"
MQTT_PORT = 1883 MQTT_PORT = 1883
MQTT_USER = "<username>" MQTT_USER = "{{ server_nagios_username }}"
MQTT_PASSWORD = "<password>" MQTT_PASSWORD = "{{ server_nagios_password }}"
SOCK_PROT_PORT = 8380 SOCK_PROT_PORT = 8380

View File

@ -1,8 +1,24 @@
#!/bin/sh #!/bin/bash
# #
BASEPATH=`realpath $(dirname $0)` BASEPATH=`realpath $(dirname $0)`
python3 -m venv $BASEPATH/venv #
$BASEPATH/venv/bin/pip install --upgrade pip # Create venv
find $BASEPATH -name requirements.txt | xargs -L 1 $BASEPATH/venv/bin/pip install -r #
$BASEPATH/venv/bin/pip list --outdated --format=json | jq -r '.[] | .name'|xargs -n1 $BASEPATH/venv/bin/pip install -U if [[ ! -e $BASEPATH/venv ]]; then
python3 -m venv $BASEPATH/venv > /dev/null 2>&1
# $BASEPATH/venv/bin/pip install --upgrade pip
find $BASEPATH -name requirements.txt | xargs -L 1 $BASEPATH/venv/bin/pip install -r > /dev/null 2>&1
echo "venv changed"
fi
#
# Update venv modules
#
for req_mod in $($BASEPATH/venv/bin/pip list --format=json | jq -r '.[] | .name'); do
$BASEPATH/venv/bin/pip install -U $req_mod | grep install > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
echo $req_mod changed
fi
done
#|xargs -n1 $BASEPATH/venv/bin/pip install -U

@ -1 +1 @@
Subproject commit 1adfb0626e7777c6d29be65d4ad4ce2d57541301 Subproject commit 328d3471a748472695a61193becdda76c7eefe69