|
@@ -7,6 +7,10 @@ rm -f /opt/backups/*
|
|
|
|
|
|
{% if backups is defined and 'containers' in backups %}
|
|
{% if backups is defined and 'containers' in backups %}
|
|
{% if containers is defined %}
|
|
{% if containers is defined %}
|
|
|
|
+{% if "chloe-testnas" in ansible_hostname %}
|
|
|
|
+echo "Stopping VPN." | ts >> "$LOG_FILE"
|
|
|
|
+nordvpn d
|
|
|
|
+{% endif %}
|
|
{% for container in containers %}
|
|
{% for container in containers %}
|
|
{% if container.volumes is defined %}
|
|
{% if container.volumes is defined %}
|
|
{% for volume in container.volumes %}
|
|
{% for volume in container.volumes %}
|
|
@@ -27,9 +31,11 @@ if [[ $? > 0 ]]; then
|
|
https://ntfy.warchildstory.com/{{ ntfy_server_notifications }}
|
|
https://ntfy.warchildstory.com/{{ ntfy_server_notifications }}
|
|
fi
|
|
fi
|
|
echo "Finished backup of '{{ container.name }}:{{ volume | regex_replace(':.*') }}'." | ts >> "$LOG_FILE"
|
|
echo "Finished backup of '{{ container.name }}:{{ volume | regex_replace(':.*') }}'." | ts >> "$LOG_FILE"
|
|
|
|
+{% if "chloe-testnas" not in ansible_hostname %}
|
|
echo "Starting '{{ container.name }}' service..." | ts >> "$LOG_FILE"
|
|
echo "Starting '{{ container.name }}' service..." | ts >> "$LOG_FILE"
|
|
systemctl start {{ container.name }}
|
|
systemctl start {{ container.name }}
|
|
echo "Service '{{ container.name }}' started." | ts >> "$LOG_FILE"
|
|
echo "Service '{{ container.name }}' started." | ts >> "$LOG_FILE"
|
|
|
|
+{% endif %}
|
|
|
|
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
@@ -42,6 +48,15 @@ echo "Backing up tarballs to B2..." | ts >> "$LOG_FILE"
|
|
--log-file="$LOG_FILE" -v
|
|
--log-file="$LOG_FILE" -v
|
|
echo "Finished backing up tarballs to B2." | ts >> "$LOG_FILE"
|
|
echo "Finished backing up tarballs to B2." | ts >> "$LOG_FILE"
|
|
|
|
|
|
|
|
+{% if "chloe-testnas" in ansible_hostname %}
|
|
|
|
+echo "Starting VPN..." | ts >> "$LOG_FILE"
|
|
|
|
+nordvpn c
|
|
|
|
+{% for container in containers %}
|
|
|
|
+echo "Starting {{ container.name }}." | ts >> "$LOG_FILE"
|
|
|
|
+systemctl start {{ container.name }}
|
|
|
|
+{% endfor %}
|
|
|
|
+{% endif %}
|
|
|
|
+
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
|