Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

94 righe
2.2 KiB

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