summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2020-04-02 11:19:26 -0400
committerThedro Neely <thedroneely@gmail.com>2020-04-02 11:19:26 -0400
commitb18d6064f045e3aed6b83f7ff7466cbc051c15c5 (patch)
tree9b5bf673749375c1ca12abb55911ab8298d71c63
parenta5831df1762d74835b1737bd08a5960b8bf7ce2a (diff)
downloadplaybooks-b18d6064f045e3aed6b83f7ff7466cbc051c15c5.tar.gz
playbooks-b18d6064f045e3aed6b83f7ff7466cbc051c15c5.tar.bz2
playbooks-b18d6064f045e3aed6b83f7ff7466cbc051c15c5.zip
roles/healthchecks/main: Add maintenance and basic test
-rw-r--r--roles/healthchecks/main.yml28
1 files changed, 27 insertions, 1 deletions
diff --git a/roles/healthchecks/main.yml b/roles/healthchecks/main.yml
index ed41d76..c8f2e90 100644
--- a/roles/healthchecks/main.yml
+++ b/roles/healthchecks/main.yml
@@ -71,7 +71,9 @@
./manage.py migrate
args:
chdir: "{{ healthchecks_home }}"
- creates: hc.sqlite
+ changed_when: false
+ register: output
+ - debug: var=output
- name: Setting up application assets
blockinfile:
@@ -101,6 +103,21 @@
SECRET = "{{ secret_key }}"
create: yes
+ - name: Performing maintenance
+ shell: |
+ . bin/activate
+ ./manage.py prunepings
+ ./manage.py prunenotifications
+ ./manage.py pruneusers
+ ./manage.py prunetokenbucket
+ ./manage.py pruneflips
+ ./manage.py compress
+ args:
+ chdir: "{{ healthchecks_home }}"
+ changed_when: false
+ register: output
+ - debug: var=output
+
become: true
become_user: "{{ healthchecks_user }}"
@@ -120,3 +137,12 @@
- name: Waiting for supervisor to become active
wait_for:
port: 9100
+
+ - name: Waiting for application to become active
+ wait_for:
+ port: 8000
+
+ - name: Testing if page exists
+ uri:
+ url: http://0.0.0.0:8000
+ return_content: yes