Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

107 linhas
2.6 KiB

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