Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uptime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
uptime
Commits
ee9f8612
Commit
ee9f8612
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-playbooks/general#85 Linting
parent
98265c7b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
defaults/main.yml
+9
-9
9 additions, 9 deletions
defaults/main.yml
handlers/main.yml
+1
-1
1 addition, 1 deletion
handlers/main.yml
tasks/main.yml
+31
-29
31 additions, 29 deletions
tasks/main.yml
templates/production.yaml
+8
-8
8 additions, 8 deletions
templates/production.yaml
with
49 additions
and
47 deletions
defaults/main.yml
+
9
−
9
View file @
ee9f8612
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
This diff is collapsed.
Click to expand it.
handlers/main.yml
+
1
−
1
View file @
ee9f8612
---
# file: roles/uptime/handlers/main.yml
-
name
:
"
Restart
Uptime
"
-
name
:
Restart Uptime
service
:
name='node-uptime'
state='restarted'
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
31
−
29
View file @
ee9f8612
---
# 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
This diff is collapsed.
Click to expand it.
templates/production.yaml
+
8
−
8
View file @
ee9f8612
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment