Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

106 строки
2.5 KiB

  1. - name: Install prerequisite apt packages on target
  2. apt:
  3. name:
  4. - sysstat
  5. - curl
  6. state: present
  7. - name: Install prerequisite yum packages on AWX
  8. delegate_to: 127.0.0.1
  9. yum:
  10. name:
  11. - bind-utils
  12. state: present
  13. - name: Install prerequisite pip packages on AWX
  14. delegate_to: 127.0.0.1
  15. pip:
  16. name:
  17. - dnspython
  18. state: present
  19. - name: Calculate MAU value
  20. shell: |
  21. curl -s localhost:9000 | grep "^synapse_admin_mau_current "
  22. register: mau_stat
  23. no_log: True
  24. - name: Print MAU value
  25. debug:
  26. msg: "{{ mau_stat.stdout.split('\n') }}"
  27. when: mau_stat is defined
  28. - name: Calculate CPU usage statistics
  29. shell: iostat -c
  30. register: cpu_usage_stat
  31. no_log: True
  32. - name: Print CPU usage statistics
  33. debug:
  34. msg: "{{ cpu_usage_stat.stdout.split('\n') }}"
  35. when: cpu_usage_stat is defined
  36. - name: Calculate RAM usage statistics
  37. shell: free -mh
  38. register: ram_usage_stat
  39. no_log: True
  40. - name: Print RAM usage statistics
  41. debug:
  42. msg: "{{ ram_usage_stat.stdout.split('\n') }}"
  43. when: ram_usage_stat is defined
  44. - name: Calculate free disk space
  45. shell: df -h
  46. register: disk_space_stat
  47. no_log: True
  48. - name: Print free disk space
  49. debug:
  50. msg: "{{ disk_space_stat.stdout.split('\n') }}"
  51. when: disk_space_stat is defined
  52. - name: Calculate size of Synapse database
  53. shell: du -sh /matrix/postgres/data
  54. register: db_size_stat
  55. no_log: True
  56. - name: Print size of Synapse database
  57. debug:
  58. msg: "{{ db_size_stat.stdout.split('\n') }}"
  59. when: db_size_stat is defined
  60. - name: Calculate size of local media repository
  61. shell: du -sh /matrix/synapse/storage/media-store/local*
  62. register: local_media_size_stat
  63. ignore_errors: yes
  64. no_log: True
  65. - name: Print size of local media repository
  66. debug:
  67. msg: "{{ local_media_size_stat.stdout.split('\n') }}"
  68. when: local_media_size_stat is defined
  69. - name: Calculate size of remote media repository
  70. shell: du -sh /matrix/synapse/storage/media-store/remote*
  71. register: remote_media_size_stat
  72. ignore_errors: yes
  73. no_log: True
  74. - name: Print size of remote media repository
  75. debug:
  76. msg: "{{ remote_media_size_stat.stdout.split('\n') }}"
  77. when: remote_media_size_stat is defined
  78. - name: Calculate docker container statistics
  79. shell: docker stats --all --no-stream
  80. register: docker_stats
  81. ignore_errors: yes
  82. no_log: True
  83. - name: Print docker container statistics
  84. debug:
  85. msg: "{{ docker_stats.stdout.split('\n') }}"
  86. when: docker_stats is defined