2018-02-09 21:00:58 +01:00
|
|
|
---
|
2019-11-21 19:53:30 +01:00
|
|
|
- name: "(Install: CentOS) Install GeoIP Required CentOS Dependencies"
|
|
|
|
yum:
|
2020-07-28 12:26:38 +02:00
|
|
|
name: epel-release
|
2019-11-21 19:53:30 +01:00
|
|
|
when: ansible_distribution == "CentOS"
|
|
|
|
|
2018-04-12 19:20:39 +02:00
|
|
|
- name: "(Install: All OSs) Install NGINX Open Source GeoIP Module"
|
2018-02-09 21:00:58 +01:00
|
|
|
package:
|
2020-04-18 00:40:35 +02:00
|
|
|
name: "nginx-module-geoip{{ nginx_version | default('') }}"
|
2018-02-09 21:00:58 +01:00
|
|
|
state: present
|
2018-09-15 01:28:20 +02:00
|
|
|
when: nginx_type == "opensource"
|
2018-02-09 21:00:58 +01:00
|
|
|
|
|
|
|
- name: "(Install: All OSs) Install NGINX Plus GeoIP Module"
|
|
|
|
package:
|
2020-04-18 00:40:35 +02:00
|
|
|
name: "nginx-plus-module-geoip{{ nginx_version | default('') }}"
|
2018-02-09 21:00:58 +01:00
|
|
|
state: present
|
2018-09-15 01:28:20 +02:00
|
|
|
when: nginx_type == "plus"
|
2018-02-09 21:00:58 +01:00
|
|
|
|
|
|
|
- name: "(Setup: All NGINX) Load NGINX GeoIP Module"
|
2019-01-21 17:20:16 +01:00
|
|
|
lineinfile:
|
2018-02-09 21:00:58 +01:00
|
|
|
path: /etc/nginx/nginx.conf
|
|
|
|
insertbefore: BOF
|
2019-01-21 17:20:16 +01:00
|
|
|
line: "{{ item }}"
|
2020-07-08 14:55:15 +02:00
|
|
|
loop:
|
2019-01-21 17:20:16 +01:00
|
|
|
- load_module modules/ngx_http_geoip_module.so;
|
|
|
|
- load_module modules/ngx_stream_geoip_module.so;
|
2020-08-19 18:39:17 +02:00
|
|
|
when: not nginx_main_template_enable | bool
|
2018-02-09 21:00:58 +01:00
|
|
|
notify: "(Handler: All OSs) Reload NGINX"
|