dashboard.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. - name: Ensure Uchiwa directory exists
  3. file: dest={{ uchiwa_path }} state=directory
  4. owner={{ sensu_user_name }} group={{ sensu_group_name }}
  5. recurse=yes
  6. - name: Ensure Uchiwa config directory exists
  7. file: dest={{ uchiwa_path }}/etc state=directory
  8. owner={{ sensu_user_name }} group={{ sensu_group_name }}
  9. recurse=yes
  10. - name: Ensure Uchiwa Go directory exists
  11. file: dest={{ uchiwa_path }}/go state=directory
  12. owner={{ sensu_user_name }} group={{ sensu_group_name }}
  13. recurse=yes
  14. - name: Ensure Uchiwa GOPATH exists
  15. file: dest={{ uchiwa_path }}/go/{{ item }}
  16. owner={{ sensu_user_name }}
  17. group={{ sensu_group_name }}
  18. state=directory recurse=yes
  19. with_items:
  20. - bin
  21. - pkg
  22. - src
  23. - name: Fetch Uchiwa from GitHub
  24. command: go get github.com/sensu/uchiwa
  25. environment:
  26. GOPATH: "{{ uchiwa_path }}/go"
  27. sudo: yes
  28. sudo_user: "{{ sensu_user_name }}"
  29. args:
  30. creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
  31. - name: Build and deploy Uchiwa
  32. shell: npm install --production chdir={{ uchiwa_path }}/go/src/github.com/sensu/uchiwa
  33. args:
  34. creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa/public/bower_components"
  35. sudo: yes
  36. sudo_user: "{{ sensu_user_name }}"
  37. - name: Deploy Uchiwa config
  38. template: src=uchiwa_config.json.j2 dest={{ uchiwa_path }}/etc/config.json
  39. owner={{ sensu_user_name }} group={{ sensu_group_name }}
  40. notify: restart uchiwa service
  41. - name: Deploy Uchiwa service script
  42. template: src=uchiwa.sh.j2
  43. dest=/opt/local/lib/svc/method/uchiwa
  44. owner=root group=root mode=755
  45. notify: restart uchiwa service
  46. - name: Deploy Uchiwa service manifest
  47. template: dest=/opt/local/lib/svc/manifest/uchiwa.xml
  48. src=uchiwa.smartos_smf_manifest.xml.j2
  49. owner=root group=root mode=644
  50. notify: import uchiwa service
  51. - name: Initial import of Uchiwa server service
  52. command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/uchiwa.xml
  53. args:
  54. creates: "/var/svc/log/application-uchiwa:default.log"
  55. - name: Ensure Uchiwa server service is running
  56. service: name=uchiwa state=started enabled=yes