dashboard.yml 2.2 KB

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