updates
This commit is contained in:
@@ -9,6 +9,21 @@
|
||||
36346437353963333839656163623933616662326132373036636166616538343966356361636164
|
||||
3035656163616631330a663363343363643065356535356633623638376430326539363536666638
|
||||
65333930613135333364383462363233386662386531323935353932373465363234
|
||||
geoip_username: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
30656365643463396265633130356339386433633331613130633134336633643637653761623962
|
||||
3633336466326564616432373031303530376166353436610a323033353164313436613363613836
|
||||
30303931323234306162343361643162313238313234383837323530343936343134326365666166
|
||||
3438643238626266320a333732363461613834613833303436363534393031323333613534333534
|
||||
3438
|
||||
geoip_license: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
32336437653435396231663666643631373638616533653538333934356339666661313439343566
|
||||
6462303439666233316162653430363239393031633362630a323533393233633164613031646633
|
||||
62366362383162306563383235373262326262323337303333313163653838613436316337633063
|
||||
3630356262666338320a333137333063303534386437343762616665383034336365663732343566
|
||||
36376463313964333834373435653564346333396538306337333762613737643363636364353139
|
||||
3032383564333638613566633363666430356230326231633636
|
||||
tasks:
|
||||
- name: Install podman
|
||||
ansible.builtin.apt:
|
||||
@@ -31,6 +46,18 @@
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy compose
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: /opt/monitoring/docker-compose.yml
|
||||
mode: '0644'
|
||||
|
||||
- name: Compose down
|
||||
changed_when: true
|
||||
ansible.builtin.command:
|
||||
cmd: podman-compose down
|
||||
chdir: /opt/monitoring
|
||||
|
||||
- name: Copy prometheus config
|
||||
ansible.builtin.copy:
|
||||
src: prometheus_config.yml
|
||||
@@ -49,17 +76,50 @@
|
||||
dest: /opt/monitoring/config.alloy
|
||||
mode: '0644'
|
||||
|
||||
- name: Copy compose
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: /opt/monitoring/docker-compose.yml
|
||||
mode: '0644'
|
||||
- name: Enable podman.socket
|
||||
ansible.builtin.service:
|
||||
name: podman.socket
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Compose down
|
||||
changed_when: true
|
||||
ansible.builtin.command:
|
||||
cmd: podman-compose down
|
||||
chdir: /opt/monitoring
|
||||
- name: Delete database directory
|
||||
ansible.builtin.file:
|
||||
path: /opt/monitoring/database
|
||||
state: absent
|
||||
mode: '0755'
|
||||
|
||||
- name: Create database directory
|
||||
ansible.builtin.file:
|
||||
path: /opt/monitoring/database
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Download geoip database
|
||||
ansible.builtin.get_url:
|
||||
url: "https://download.maxmind.com/geoip/databases/GeoLite2-City/download?suffix=tar.gz"
|
||||
dest: /opt/monitoring
|
||||
username: "{{ geoip_username }}"
|
||||
password: "{{ geoip_license }}"
|
||||
mode: '0644'
|
||||
tags:
|
||||
- never
|
||||
- geoip
|
||||
|
||||
- name: Get geoip tar file
|
||||
ansible.builtin.find:
|
||||
paths: /opt/monitoring
|
||||
file_type: file
|
||||
patterns: '^GeoLite.*.tar.gz$'
|
||||
use_regex: true
|
||||
limit: 1
|
||||
register: found
|
||||
|
||||
- name: Extract geopip database
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: true
|
||||
src: "{{ found.files[0].path }}"
|
||||
dest: /opt/monitoring/database
|
||||
extra_opts: ['--strip-components=1', '--show-stored-names']
|
||||
|
||||
- name: Compose up
|
||||
changed_when: true
|
||||
|
||||
Reference in New Issue
Block a user