This commit is contained in:
parent
f8528e1ef6
commit
078b97b138
8
states/geoip/defaults.yaml
Normal file
8
states/geoip/defaults.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
geoip:
|
||||||
|
basepath: /usr/share/GeoIP
|
||||||
|
version: 2023.03.26
|
||||||
|
url: https://git.paulbsd.com/paulbsd/GeoLite.mmdb/releases/download
|
||||||
|
dbs:
|
||||||
|
- GeoLite2-City.mmdb
|
||||||
|
- GeoLite2-ASN.mmdb
|
4
states/geoip/init.sls
Normal file
4
states/geoip/init.sls
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
{%- from "geoip/map.jinja" import geoip with context %}
|
||||||
|
include:
|
||||||
|
- .install
|
13
states/geoip/install.sls
Normal file
13
states/geoip/install.sls
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
{%- from "geoip/map.jinja" import geoip with context %}
|
||||||
|
{% for dbname in geoip.dbs %}
|
||||||
|
geoip-geoip-{{ dbname }}:
|
||||||
|
file.managed:
|
||||||
|
- name: {{ geoip.basepath }}/geoip/{{ dbname }}
|
||||||
|
- source: {{ geoip.url }}/{{ geoip.version }}/{{ dbname }}
|
||||||
|
- skip_verify: True
|
||||||
|
- makedirs: True
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- mode: "0644"
|
||||||
|
{% endfor %}
|
3
states/geoip/map.jinja
Normal file
3
states/geoip/map.jinja
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{%- import_yaml "geoip/defaults.yaml" as defaults -%}
|
||||||
|
|
||||||
|
{%- set geoip = salt['pillar.get']('geoip', default=defaults.geoip, merge=True) -%}
|
Loading…
Reference in New Issue
Block a user