Skip to content
Snippets Groups Projects
Commit 70953e89 authored by jurgenhaas's avatar jurgenhaas
Browse files

Allow usage as a monitor only

parent 3217f98a
Branches main
No related tags found
No related merge requests found
uptime_url: 'http://localhost:8082'
uptime_mode: 'main'
uptime_domain: 'localhost:8082'
uptime_username: 'uptime'
uptime_password: 'j^A8@IU#eoxo#P6i'
......
......@@ -2,5 +2,5 @@
dependencies:
- { role: common }
- { role: mongodb }
- { role: mongodb, when: uptime_mode == 'main' }
- { role: nodejs }
# Original code:
# https://github.com/fzaninotto/uptime
---
# file: roles/uptime/tasks/main.yml
......@@ -12,40 +9,41 @@
- name: "Ensure uptime user"
mongodb_user:
database=uptime
login_database=admin
login_user=root
login_password=root
name=root
password=root
database: 'uptime'
login_database: 'admin'
login_user: 'root'
login_password: 'root'
name: 'root'
password: 'root'
ignore_errors: yes
when: uptime_mode == 'main'
- name: "Ensure directory"
file:
path='/var/www'
state=directory
mode=0755
path: '/var/www'
state: 'directory'
mode: '0755'
- name: "Checkout latest version of Uptime"
git:
repo='https://gitlab.paragon-es.de/tools/uptime.git'
dest='/var/www/uptime'
repo: 'https://gitlab.paragon-es.de/tools/uptime.git'
dest: '/var/www/uptime'
notify:
- "Restart Uptime"
- name: "Install node components"
npm:
path='/var/www/uptime'
path: '/var/www/uptime'
notify:
- "Restart Uptime"
- name: "Configure uptime"
template:
src='production.yaml'
dest='/var/www/uptime/config/production.yaml'
owner=root
group=root
mode=644
src: 'production.yaml'
dest: '/var/www/uptime/config/production.yaml'
owner: root
group: root
mode: 644
notify:
- "Restart Uptime"
......@@ -62,14 +60,4 @@
notify:
- "Restart Uptime"
# Config Uptime
# edit config/default.yml
# Start uptime
# node app
# Production Environment
# NODE_ENV=production node app
# http://localhost:8082/
when: '"uptime" not in excluded_roles'
url: '{{ uptime_url }}'
url: 'https://{{ uptime_domain }}'
mongodb:
server: localhost
......@@ -7,16 +7,16 @@ mongodb:
password: root
monitor:
name: origin
apiUrl: '{{ uptime_url }}/api'
name: {{ inventory_hostname }}
apiUrl: 'https://{{ uptime_domain }}/api'
pollingInterval: 10000
timeout: 5000
userAgent: NodeUptime/3.0 (https://github.com/fzaninotto/uptime)
userAgent: Uptime (https://gitlab.paragon-es.de/tools/uptime)
ssl:
enabled: true
certificate: '/etc/letsencrypt/live/{{ default_domain }}/fullchain.pem'
key: '/etc/letsencrypt/live/{{ default_domain }}/privkey.pem'
certificate: '/etc/letsencrypt/live/{{ uptime_domain }}/fullchain.pem'
key: '/etc/letsencrypt/live/{{ uptime_domain }}/privkey.pem'
selfSigned: false
plugins:
......@@ -40,7 +40,7 @@ pushover:
hipchat:
roomId: {{ uptime_hipchat_roomid }}
token: {{ uptime_hipchat_token }}
uptimeDashboardURL: {{ uptime_url }}
uptimeDashboardURL: 'https://{{ uptime_domain }}'
event:
up: true
down: true
......@@ -51,7 +51,7 @@ mattermost:
hook: {{ uptime_mattermost_hook }}
username: Uptime
gitlab: True
uptimeDashboardURL: {{ uptime_url }}
uptimeDashboardURL: 'https://{{ uptime_domain }}'
event:
up: true
down: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment