aboutsummaryrefslogtreecommitdiffstats
path: root/roles/nginx-geoip/tasks
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2022-02-23 20:38:17 +0100
committerGravatar Johannes Christ <[email protected]>2022-02-25 00:02:15 +0100
commit61d7342d2c2fc78bbea51773421e7039252e5651 (patch)
treecb3a8b228929016d15abdde8d3eff038a9b2960b /roles/nginx-geoip/tasks
parentDeploy Prometheus & node-exporter (diff)
Configure GeoIP for moon phase support
In order to add moon phase support on the dark theme picker later, we need to configure the GeoIP module included with nginx. On Debian, the `nginx` package that we install installs `nginx-core`, which in turn installs the GeoIP module and even a GeoIP country database for us.
Diffstat (limited to 'roles/nginx-geoip/tasks')
-rw-r--r--roles/nginx-geoip/tasks/main.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/nginx-geoip/tasks/main.yml b/roles/nginx-geoip/tasks/main.yml
new file mode 100644
index 0000000..3601828
--- /dev/null
+++ b/roles/nginx-geoip/tasks/main.yml
@@ -0,0 +1,16 @@
+---
+# ref https://packages.debian.org/bullseye/amd64/libnginx-mod-http-geoip/filelist
+# installed by default in debian nginx package, including "geoip-database" dep
+# see https://packages.debian.org/bullseye/amd64/geoip-database/filelist
+- name: configure the geoip module
+ copy:
+ # ref https://nginx.org/en/docs/http/ngx_http_geoip_module.html
+ content: geoip_country /usr/share/GeoIP/GeoIP.dat;
+ dest: /etc/nginx/conf.d/geoip.conf
+ owner: root
+ group: root
+ mode: 0444
+ tags:
+ - role::nginx-geoip
+ notify:
+ - reload the nginx service