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

ansible-playbooks/general#85 Linting

parent 98265c7b
Branches
No related tags found
No related merge requests found
uptime_mode: 'main'
uptime_domain: 'localhost:8082'
uptime_username: 'uptime'
uptime_password: 'j^A8@IU#eoxo#P6i'
uptime_mode: main
uptime_domain: localhost:8082
uptime_username: uptime
uptime_password: j^A8@IU#eoxo#P6i
uptime_pushover_token: 'placeholder'
uptime_pushover_user: 'placeholder'
uptime_pushover_token: placeholder
uptime_pushover_user: placeholder
uptime_hipchat_token: 'placeholder'
uptime_hipchat_roomid: 'placeholder'
uptime_hipchat_token: placeholder
uptime_hipchat_roomid: placeholder
uptime_plugins:
- console
......@@ -21,4 +21,4 @@ uptime_plugins.off:
- pushover
- hipchat
uptime_webpagetest_api: 'placeholder'
uptime_webpagetest_api: placeholder
---
# file: roles/uptime/handlers/main.yml
- name: "Restart Uptime"
- name: Restart Uptime
service:
name='node-uptime'
state='restarted'
---
# file: roles/uptime/tasks/main.yml
- name: "Uptime Role"
set_fact: role_uptime_started=true
tags: 'always'
- name: Uptime Role
set_fact:
role_uptime_started: yes
tags:
- always
- block:
- name: "Ensure uptime user"
- 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"
- name: Ensure directory
file:
path: '/var/www'
state: 'directory'
mode: '0755'
path: /var/www
state: directory
mode: 0755
- name: "Checkout latest version of Uptime"
- name: Checkout latest version of Uptime
git:
repo: 'https://gitlab.lakedrops.com/tools/uptime.git'
dest: '/var/www/uptime'
repo: https://gitlab.lakedrops.com/tools/uptime.git
dest: /var/www/uptime
force: yes
notify:
- "Restart Uptime"
- name: "Install node components"
- name: Install node components
npm:
path: '/var/www/uptime'
path: /var/www/uptime
notify:
- "Restart Uptime"
- name: "Configure uptime"
- name: Configure uptime
template:
src: 'production.yaml'
dest: '/var/www/uptime/config/production.yaml'
src: production.yaml
dest: /var/www/uptime/config/production.yaml
owner: root
group: root
mode: '644'
mode: 644
notify:
- "Restart Uptime"
- name: "List Patches"
shell: 'ls /var/www/uptime/patches -1'
- name: List Patches
shell: ls /var/www/uptime/patches -1
register: patch_list
- name: "Apply Patches"
shell: 'patch -p1 --ignore-whitespace --forward < /var/www/uptime/patches/{{ item }}'
- name: Apply Patches
shell: patch -p1 --ignore-whitespace --forward < /var/www/uptime/patches/{{ item }}
args:
chdir: '/var/www/uptime'
chdir: /var/www/uptime
with_items: '{{ patch_list.stdout_lines }}'
ignore_errors: True
notify:
- "Restart Uptime"
when: '"uptime" not in excluded_roles'
when: not excluded_roles or "uptime" not in excluded_roles
url: 'https://{{ uptime_domain }}'
url: https://{{ uptime_domain }}
mongodb:
server: localhost
......@@ -15,8 +15,8 @@ monitor:
ssl:
enabled: true
certificate: '/etc/letsencrypt/live/{{ uptime_domain }}/fullchain.pem'
key: '/etc/letsencrypt/live/{{ uptime_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: 'https://{{ uptime_domain }}'
uptimeDashboardURL: https://{{ uptime_domain }}
event:
up: true
down: true
......@@ -51,7 +51,7 @@ mattermost:
hook: {{ uptime_mattermost_hook }}
username: Uptime
gitlab: True
uptimeDashboardURL: 'https://{{ uptime_domain }}'
uptimeDashboardURL: https://{{ uptime_domain }}
event:
up: true
down: true
......@@ -59,6 +59,6 @@ mattermost:
restarted: false
webPageTest:
server: 'http://www.webpagetest.org'
key: '{{ uptime_webpagetest_api }}'
testOptions: '--private'
server: http://www.webpagetest.org
key: {{ uptime_webpagetest_api }}
testOptions: --private
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment