deploy: teach the drift check about the nginx logs route
The drift check renders the nginx template with sed before diffing, but the new logs location added two more templated values, so a clean deploy would have looked like drift. Both are substituted now
Pedro Lucas Porcellis porcellis@eletrotupi.com · 14 days ago
c8bab449d13fa00dadc0138ef8f83f18104eb593 Browse filesParents
cb9679cChanged files
1
Additions
+2
Deletions
0
ansible/scripts/pull-live-configs.sh
1 1
#!/usr/bin/env bash
2 2
#
3 3
# Pull the live deployment configs from the VPS and diff them against the repo
4 4
# Read-only on the server. Exits non-zero if anything has drifted
5 5
#
64 64
sed \
65 65
-e "s/{{ vhosts\[0\] }}/${vhost}/g" \
66 66
-e 's/{{ nginx_cert_dir }}/\/etc\/ssl\/uacme/g' \
67 67
-e 's/{{ nginx_static_root }}/\/srv\/static/g' \
68 68
-e 's/{{ nginx_proxy_pass }}/http:\/\/127.0.0.1:3000/g' \
69 +
-e 's/{{ nginx_logs_proxy_pass }}/http:\/\/127.0.0.1:9428/g' \
70 +
-e 's/{{ nginx_logs_htpasswd_file }}/\/etc\/nginx\/.htpasswd-logs/g' \
69 71
"$ansible_dir/roles/nginx/templates/site.https.j2"
70 72
}
71 73
72 74
status=0
73 75
113 115
echo "No drift."
114 116
else
115 117
echo "Drift detected: re-run the matching playbook (deploy.yml / app.yml)"
116 118
fi
117 119
exit "$status"