Install statping

This commit is contained in:
Jake Howard 2020-03-08 16:41:13 +00:00
parent dd956450dc
commit 6f1258232c
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 61 additions and 2 deletions

View 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

View file

@ -3,8 +3,9 @@ http:
internal-only:
ipWhiteList:
sourceRange:
- "{{ wireguard.cidr }}"
- "192.168.1.0/24"
- "10.0.0.0/8"
- "172.16.0.0/12"
- "192.168.0.0/16"
hsts:
redirectScheme:
scheme: https

View file

@ -63,3 +63,6 @@
- name: Install folding-at-home
include: folding-at-home.yml
- name: Install statping
include: statping.yml

View 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