dashboard.yml 2.2 KB

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