Install statping
This commit is contained in:
parent
dd956450dc
commit
6f1258232c
4 changed files with 61 additions and 2 deletions
24
ansible/roles/docker/files/statping/docker-compose.yml
Normal file
24
ansible/roles/docker/files/statping/docker-compose.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
statping:
|
||||||
|
image: hunterlong/statping:v0.80.70
|
||||||
|
container_name: statping
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./statping:/app
|
||||||
|
dns: "{{ wireguard.clients.intersect.ip }}"
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.statping.rule=Host(`stats.theorangeone.net`)"
|
||||||
|
- "traefik.http.routers.statping.tls=true"
|
||||||
|
- "traefik.http.routers.statping.tls.certresolver=le"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:12-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./postgres:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=statping
|
||||||
|
- POSTGRES_USER=statping
|
|
@ -3,8 +3,9 @@ http:
|
||||||
internal-only:
|
internal-only:
|
||||||
ipWhiteList:
|
ipWhiteList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- "{{ wireguard.cidr }}"
|
- "10.0.0.0/8"
|
||||||
- "192.168.1.0/24"
|
- "172.16.0.0/12"
|
||||||
|
- "192.168.0.0/16"
|
||||||
hsts:
|
hsts:
|
||||||
redirectScheme:
|
redirectScheme:
|
||||||
scheme: https
|
scheme: https
|
||||||
|
|
|
@ -63,3 +63,6 @@
|
||||||
|
|
||||||
- name: Install folding-at-home
|
- name: Install folding-at-home
|
||||||
include: folding-at-home.yml
|
include: folding-at-home.yml
|
||||||
|
|
||||||
|
- name: Install statping
|
||||||
|
include: statping.yml
|
||||||
|
|
31
ansible/roles/docker/tasks/statping.yml
Normal file
31
ansible/roles/docker/tasks/statping.yml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
- name: Create statping directory
|
||||||
|
file:
|
||||||
|
path: '/opt/statping'
|
||||||
|
state: directory
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
mode: "{{ docker_compose_directory_mask }}"
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
- name: Install statping compose file
|
||||||
|
template:
|
||||||
|
src: files/statping/docker-compose.yml
|
||||||
|
dest: "/opt/statping/docker-compose.yml"
|
||||||
|
mode: "{{ docker_compose_file_mask }}"
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
validate: /usr/bin/docker-compose -f %s config
|
||||||
|
register: compose_file
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
- name: Cycle statping container
|
||||||
|
docker_compose:
|
||||||
|
project_src: /opt/statping
|
||||||
|
pull: true
|
||||||
|
remove_orphans: true
|
||||||
|
remove_volumes: true
|
||||||
|
state: "{{ item }}"
|
||||||
|
when: compose_file.changed
|
||||||
|
loop:
|
||||||
|
- absent
|
||||||
|
- present
|
Loading…
Reference in a new issue