Matrix Docker Ansible eploy
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

109 rindas
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. async: 600
  45. ignore_errors: true
  46. no_log: true
  47. - name: Calculate size of remote media repository
  48. shell: du -sh /matrix/synapse/storage/media-store/remote*
  49. register: awx_remote_media_size_stat
  50. async: 600
  51. ignore_errors: true
  52. no_log: true
  53. - name: Calculate docker container statistics
  54. shell: docker stats --all --no-stream
  55. register: awx_docker_stats
  56. ignore_errors: true
  57. no_log: true
  58. - name: Print size of remote media repository
  59. debug:
  60. msg: "{{ awx_remote_media_size_stat.stdout.split('\n') }}"
  61. when: awx_remote_media_size_stat is defined
  62. - name: Print size of local media repository
  63. debug:
  64. msg: "{{ awx_local_media_size_stat.stdout.split('\n') }}"
  65. when: awx_local_media_size_stat is defined
  66. - name: Print size of Synapse database
  67. debug:
  68. msg: "{{ awx_db_size_stat.stdout.split('\n') }}"
  69. when: awx_db_size_stat is defined
  70. - name: Print free disk space
  71. debug:
  72. msg: "{{ awx_disk_space_stat.stdout.split('\n') }}"
  73. when: awx_disk_space_stat is defined
  74. - name: Print RAM usage statistics
  75. debug:
  76. msg: "{{ awx_ram_usage_stat.stdout.split('\n') }}"
  77. when: awx_ram_usage_stat is defined
  78. - name: Print CPU usage statistics
  79. debug:
  80. msg: "{{ awx_cpu_usage_stat.stdout.split('\n') }}"
  81. when: awx_cpu_usage_stat is defined
  82. - name: Print MAU value
  83. debug:
  84. msg: "{{ awx_mau_stat.stdout.split('\n') }}"
  85. when: awx_mau_stat is defined
  86. - name: Print docker container statistics
  87. debug:
  88. msg: "{{ awx_docker_stats.stdout.split('\n') }}"
  89. when: awx_docker_stats is defined