matrix-docker-ansible-deploy/roles/matrix-awx/tasks/self_check.yml

109 lines
2.6 KiB
YAML
Raw Normal View History

2021-10-10 05:23:49 +00:00
---
2021-08-13 08:05:57 +00:00
- name: Install prerequisite apt packages on target
apt:
name:
- sysstat
- curl
state: present
- name: Install prerequisite yum packages on AWX
delegate_to: 127.0.0.1
yum:
name:
- bind-utils
state: present
- name: Install prerequisite pip packages on AWX
delegate_to: 127.0.0.1
pip:
name:
- dnspython
state: present
- name: Calculate MAU value
shell: |
curl -s localhost:9000 | grep "^synapse_admin_mau_current "
2021-10-10 05:23:49 +00:00
register: awx_mau_stat
no_log: true
2021-08-13 08:05:57 +00:00
- name: Calculate CPU usage statistics
shell: iostat -c
2021-10-10 05:23:49 +00:00
register: awx_cpu_usage_stat
no_log: true
2021-08-13 08:05:57 +00:00
- name: Calculate RAM usage statistics
shell: free -mh
2021-10-10 05:23:49 +00:00
register: awx_ram_usage_stat
no_log: true
2021-08-13 08:05:57 +00:00
- name: Calculate free disk space
shell: df -h
2021-10-10 05:23:49 +00:00
register: awx_disk_space_stat
no_log: true
2021-08-13 08:05:57 +00:00
- name: Calculate size of Synapse database
shell: du -sh /matrix/postgres/data
2021-10-10 05:23:49 +00:00
register: awx_db_size_stat
no_log: true
2021-08-13 08:05:57 +00:00
- name: Calculate size of local media repository
shell: du -sh /matrix/synapse/storage/media-store/local*
2021-10-10 05:23:49 +00:00
register: awx_local_media_size_stat
2021-12-06 03:54:31 +00:00
async: 600
ignore_errors: true
no_log: true
2021-08-13 08:05:57 +00:00
- name: Calculate size of remote media repository
shell: du -sh /matrix/synapse/storage/media-store/remote*
2021-10-10 05:23:49 +00:00
register: awx_remote_media_size_stat
2021-12-06 03:54:31 +00:00
async: 600
ignore_errors: true
no_log: true
2021-08-13 08:05:57 +00:00
- name: Calculate docker container statistics
shell: docker stats --all --no-stream
2021-10-10 05:23:49 +00:00
register: awx_docker_stats
ignore_errors: true
no_log: true
2021-08-13 08:05:57 +00:00
2021-10-10 05:23:49 +00:00
- name: Print size of remote media repository
debug:
msg: "{{ awx_remote_media_size_stat.stdout.split('\n') }}"
when: awx_remote_media_size_stat is defined
2021-10-10 05:23:49 +00:00
- name: Print size of local media repository
debug:
msg: "{{ awx_local_media_size_stat.stdout.split('\n') }}"
when: awx_local_media_size_stat is defined
- name: Print size of Synapse database
debug:
msg: "{{ awx_db_size_stat.stdout.split('\n') }}"
when: awx_db_size_stat is defined
- name: Print free disk space
debug:
msg: "{{ awx_disk_space_stat.stdout.split('\n') }}"
when: awx_disk_space_stat is defined
- name: Print RAM usage statistics
debug:
msg: "{{ awx_ram_usage_stat.stdout.split('\n') }}"
when: awx_ram_usage_stat is defined
- name: Print CPU usage statistics
debug:
msg: "{{ awx_cpu_usage_stat.stdout.split('\n') }}"
when: awx_cpu_usage_stat is defined
- name: Print MAU value
debug:
msg: "{{ awx_mau_stat.stdout.split('\n') }}"
when: awx_mau_stat is defined
2021-08-13 08:05:57 +00:00
- name: Print docker container statistics
debug:
2021-10-10 05:23:49 +00:00
msg: "{{ awx_docker_stats.stdout.split('\n') }}"
when: awx_docker_stats is defined