.
This commit is contained in:
@@ -8,7 +8,10 @@
|
|||||||
become_method: sudo
|
become_method: sudo
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
|
# vm_pass is stored in Semaphore as a secret environment variable.
|
||||||
vm_password: "{{ lookup('ansible.builtin.env', 'vm_pass') }}"
|
vm_password: "{{ lookup('ansible.builtin.env', 'vm_pass') }}"
|
||||||
|
|
||||||
|
# Other values are loaded directly from Semaphore Extra variables.
|
||||||
vm_use_sudo: "{{ use_sudo | default(false) | bool }}"
|
vm_use_sudo: "{{ use_sudo | default(false) | bool }}"
|
||||||
|
|
||||||
nextcloud_container: "nextcloud"
|
nextcloud_container: "nextcloud"
|
||||||
@@ -24,25 +27,25 @@
|
|||||||
- name: Run Nextcloud cron
|
- name: Run Nextcloud cron
|
||||||
command: >-
|
command: >-
|
||||||
docker exec -u www-data
|
docker exec -u www-data
|
||||||
{{ nextcloud_container }}
|
{{ nextcloud_container | quote }}
|
||||||
php -f /var/www/html/cron.php
|
php -f /var/www/html/cron.php
|
||||||
|
|
||||||
- name: Update Nextcloud applications
|
- name: Update Nextcloud applications
|
||||||
command: >-
|
command: >-
|
||||||
docker exec -u www-data
|
docker exec -u www-data
|
||||||
{{ nextcloud_container }}
|
{{ nextcloud_container | quote }}
|
||||||
php occ app:update --all
|
php occ app:update --all
|
||||||
|
|
||||||
- name: Run Nextcloud maintenance repair
|
- name: Run Nextcloud maintenance repair
|
||||||
command: >-
|
command: >-
|
||||||
docker exec -u www-data
|
docker exec -u www-data
|
||||||
{{ nextcloud_container }}
|
{{ nextcloud_container | quote }}
|
||||||
php occ maintenance:repair --include-expensive
|
php occ maintenance:repair --include-expensive
|
||||||
|
|
||||||
- name: Read Nextcloud status
|
- name: Read Nextcloud status
|
||||||
command: >-
|
command: >-
|
||||||
docker exec -u www-data
|
docker exec -u www-data
|
||||||
{{ nextcloud_container }}
|
{{ nextcloud_container | quote }}
|
||||||
php occ status
|
php occ status
|
||||||
|
|
||||||
- name: Check required containers
|
- name: Check required containers
|
||||||
@@ -62,7 +65,7 @@
|
|||||||
- name: Check MariaDB readiness
|
- name: Check MariaDB readiness
|
||||||
command: >-
|
command: >-
|
||||||
docker exec
|
docker exec
|
||||||
{{ nextcloud_db_container }}
|
{{ nextcloud_db_container | quote }}
|
||||||
sh -c
|
sh -c
|
||||||
'mariadb-admin ping -h 127.0.0.1 --silent 2>/dev/null
|
'mariadb-admin ping -h 127.0.0.1 --silent 2>/dev/null
|
||||||
|| mysqladmin ping -h 127.0.0.1 --silent 2>/dev/null'
|
|| mysqladmin ping -h 127.0.0.1 --silent 2>/dev/null'
|
||||||
@@ -71,7 +74,7 @@
|
|||||||
command: >-
|
command: >-
|
||||||
set -o pipefail;
|
set -o pipefail;
|
||||||
docker exec
|
docker exec
|
||||||
{{ redis_container }}
|
{{ redis_container | quote }}
|
||||||
redis-cli -h 127.0.0.1 ping
|
redis-cli -h 127.0.0.1 ping
|
||||||
| grep -qx PONG
|
| grep -qx PONG
|
||||||
|
|
||||||
@@ -94,7 +97,7 @@
|
|||||||
- vm_ip | string | trim | length > 0
|
- vm_ip | string | trim | length > 0
|
||||||
- vm_user is defined
|
- vm_user is defined
|
||||||
- vm_user | string | trim | length > 0
|
- vm_user | string | trim | length > 0
|
||||||
- vm_password | length > 0
|
- vm_password | string | length > 0
|
||||||
fail_msg: >-
|
fail_msg: >-
|
||||||
Missing vm_ip, vm_user or vm_pass.
|
Missing vm_ip, vm_user or vm_pass.
|
||||||
Check the attached Semaphore Variable Group.
|
Check the attached Semaphore Variable Group.
|
||||||
@@ -169,6 +172,9 @@
|
|||||||
Command: {{ item.item.command }}
|
Command: {{ item.item.command }}
|
||||||
RC: {{ item.rc }}
|
RC: {{ item.rc }}
|
||||||
|
|
||||||
|
STDOUT:
|
||||||
|
{{ item.stdout | default('') | trim }}
|
||||||
|
|
||||||
STDERR:
|
STDERR:
|
||||||
{{ item.stderr | default('') | trim }}
|
{{ item.stderr | default('') | trim }}
|
||||||
quiet: true
|
quiet: true
|
||||||
@@ -189,9 +195,9 @@
|
|||||||
run_once: true
|
run_once: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: >-
|
failed_when: >-
|
||||||
collabora_root.status | default(0) != 200
|
(collabora_root.status | default(0) | int != 200)
|
||||||
or
|
or
|
||||||
'OK' not in (collabora_root.content | default(''))
|
('OK' not in (collabora_root.content | default('')))
|
||||||
|
|
||||||
- name: Check external Collabora discovery endpoint
|
- name: Check external Collabora discovery endpoint
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
@@ -206,19 +212,25 @@
|
|||||||
run_once: true
|
run_once: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: >-
|
failed_when: >-
|
||||||
collabora_discovery.status | default(0) != 200
|
(collabora_discovery.status | default(0) | int != 200)
|
||||||
or
|
or
|
||||||
'<wopi-discovery' not in
|
('<wopi-discovery' not in
|
||||||
(collabora_discovery.content | default(''))
|
(collabora_discovery.content | default('')))
|
||||||
|
|
||||||
- name: Show final health summary
|
- name: Show final health summary
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: |
|
msg: |
|
||||||
Nextcloud VM checks: OK
|
Nextcloud VM connection: OK
|
||||||
Nextcloud containers: OK
|
Nextcloud cron: OK
|
||||||
MariaDB: OK
|
Nextcloud applications: OK
|
||||||
Redis: OK
|
Nextcloud maintenance repair: OK
|
||||||
Nextcloud local HTTP: OK
|
Nextcloud status: OK
|
||||||
|
Nextcloud container: OK
|
||||||
|
MariaDB container: OK
|
||||||
|
Redis container: OK
|
||||||
|
MariaDB readiness: OK
|
||||||
|
Redis readiness: OK
|
||||||
|
Nextcloud local HTTP endpoint: OK
|
||||||
Collabora root endpoint: OK
|
Collabora root endpoint: OK
|
||||||
Collabora discovery endpoint: OK
|
Collabora discovery endpoint: OK
|
||||||
run_once: true
|
run_once: true
|
||||||
Reference in New Issue
Block a user