dashboard.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ---
  2. # tasks/SmartOS/dashboard.yml: Deployment of the Uchiwa dashboard
  3. # Specific to Joyent SmartOS
  4. - name: Include ansible_distribution vars
  5. include_vars:
  6. file: "{{ ansible_distribution }}.yml"
  7. tags: dashboard
  8. - name: Ensure Uchiwa (dashboard) dependencies are installed
  9. tags: dashboard
  10. pkgin: name=go state=present
  11. - name: Ensure Uchiwa directory exists
  12. tags: dashboard
  13. file:
  14. dest: "{{ sensu_uchiwa_path }}"
  15. state: directory
  16. owner: "{{ sensu_user_name }}"
  17. group: "{{ sensu_group_name }}"
  18. recurse: true
  19. - name: Ensure Uchiwa Go/config directory exists
  20. tags: dashboard
  21. file:
  22. dest: "{{ sensu_uchiwa_path }}/{{ item }}"
  23. state: directory
  24. owner: "{{ sensu_user_name }}"
  25. group: "{{ sensu_group_name }}"
  26. recurse: true
  27. loop:
  28. - etc
  29. - go
  30. - name: Ensure Uchiwa GOPATH exists
  31. tags: dashboard
  32. file:
  33. dest: "{{ sensu_uchiwa_path }}/go/{{ item }}"
  34. owner: "{{ sensu_user_name }}"
  35. group: "{{ sensu_group_name }}"
  36. state: directory
  37. recurse: true
  38. loop:
  39. - bin
  40. - pkg
  41. - src
  42. - name: Fetch Uchiwa from GitHub
  43. tags: dashboard
  44. command: go get github.com/sensu/uchiwa
  45. environment:
  46. GOPATH: "{{ sensu_uchiwa_path }}/go"
  47. args:
  48. creates: "{{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa"
  49. notify: Build and deploy Uchiwa
  50. become: true
  51. become_user: "{{ sensu_user_name }}"
  52. - meta: flush_handlers
  53. tags: dashboard
  54. - name: Deploy Uchiwa config
  55. tags: dashboard
  56. template:
  57. src: uchiwa_config.json.j2
  58. dest: "{{ sensu_uchiwa_path }}/etc/config.json"
  59. owner: "{{ sensu_user_name }}"
  60. group: "{{ sensu_group_name }}"
  61. notify: restart uchiwa service
  62. - name: Deploy Uchiwa service script
  63. tags: dashboard
  64. template:
  65. src: uchiwa.sh.j2
  66. dest: /opt/local/lib/svc/method/uchiwa
  67. owner: root
  68. group: root
  69. mode: 0755
  70. notify: restart uchiwa service
  71. - name: Deploy Uchiwa service manifest
  72. tags: dashboard
  73. template:
  74. dest: /opt/local/lib/svc/manifest/uchiwa.xml
  75. src: uchiwa.smartos_smf_manifest.xml.j2
  76. owner: root
  77. group: root
  78. mode: 0644
  79. notify: import uchiwa service
  80. - meta: flush_handlers
  81. tags: dashboard
  82. - name: Ensure Uchiwa server service is running
  83. service: name=uchiwa state=started enabled=yes
  84. tags: dashboard