From 2adb9814fd5efedba7cdc513c37899e27141b8a4 Mon Sep 17 00:00:00 2001 From: shenlan Date: Tue, 19 Aug 2025 13:06:41 +0800 Subject: [PATCH] feat: disable GeoIP setup for OpenResty role --- .../roles/vhosts/OpenResty/tasks/geoip.yml | 23 ++++++++++++++++++ .../roles/vhosts/OpenResty/tasks/main.yml | 24 ------------------- 2 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 playbooks/roles/vhosts/OpenResty/tasks/geoip.yml diff --git a/playbooks/roles/vhosts/OpenResty/tasks/geoip.yml b/playbooks/roles/vhosts/OpenResty/tasks/geoip.yml new file mode 100644 index 0000000..2aee0ee --- /dev/null +++ b/playbooks/roles/vhosts/OpenResty/tasks/geoip.yml @@ -0,0 +1,23 @@ +- name: Install GeoIP dependencies + apt: + name: luarocks + state: present + update_cache: true + +- name: Install lua-resty-maxminddb + command: "luarocks install lua-resty-maxminddb" + args: + creates: /usr/local/openresty/site/lualib/resty/maxminddb.lua + +- name: Ensure GeoIP database directory exists + file: + path: /usr/share/GeoIP + state: directory + mode: "0755" + +# yamllint disable rule:line-length +- name: Download V2Fly GeoIP database + get_url: + url: https://github.com/v2fly/geoip/releases/latest/download/geoip.dat + dest: /usr/share/GeoIP/geoip.dat +# yamllint enable rule:line-length diff --git a/playbooks/roles/vhosts/OpenResty/tasks/main.yml b/playbooks/roles/vhosts/OpenResty/tasks/main.yml index 40c6b76..4129686 100644 --- a/playbooks/roles/vhosts/OpenResty/tasks/main.yml +++ b/playbooks/roles/vhosts/OpenResty/tasks/main.yml @@ -28,30 +28,6 @@ state: present update_cache: true -- name: Install GeoIP dependencies - apt: - name: luarocks - state: present - update_cache: true - -- name: Install lua-resty-maxminddb - command: "luarocks install lua-resty-maxminddb" - args: - creates: /usr/local/openresty/site/lualib/resty/maxminddb.lua - -- name: Ensure GeoIP database directory exists - file: - path: /usr/share/GeoIP - state: directory - mode: "0755" - -# yamllint disable rule:line-length -- name: Download V2Fly GeoIP database - get_url: - url: https://github.com/v2fly/geoip/releases/latest/download/geoip.dat - dest: /usr/share/GeoIP/geoip.dat -# yamllint enable rule:line-length - - name: Ensure sites-available directory exists file: path: /usr/local/openresty/nginx/conf/sites-available