|
@@ -0,0 +1,74 @@
|
|
|
|
|
+---
|
|
|
|
|
+# tasks/OpenBSD/dashboard.yml: Deployment of the Uchiwa dashboard
|
|
|
|
|
+# Specific to OpenBSD
|
|
|
|
|
+
|
|
|
|
|
+ - include_vars: "{{ ansible_distribution }}.yml"
|
|
|
|
|
+
|
|
|
|
|
+ - name: Ensure Uchiwa (dashboard) dependencies are installed
|
|
|
|
|
+ openbsd_pkg:
|
|
|
|
|
+ name: "{{ item }}"
|
|
|
|
|
+ state: present
|
|
|
|
|
+ with_items:
|
|
|
|
|
+ - go
|
|
|
|
|
+ - git
|
|
|
|
|
+ - npm
|
|
|
|
|
+
|
|
|
|
|
+ - name: Ensure Uchiwa directory exists
|
|
|
|
|
+ file:
|
|
|
|
|
+ dest: "{{ uchiwa_path }}"
|
|
|
|
|
+ state: directory
|
|
|
|
|
+ owner: "{{ sensu_user_name }}"
|
|
|
|
|
+ group: "{{ sensu_group_name }}"
|
|
|
|
|
+ recurse: true
|
|
|
|
|
+
|
|
|
|
|
+ - name: Ensure Uchiwa Go/config directory exists
|
|
|
|
|
+ file:
|
|
|
|
|
+ dest: "{{ uchiwa_path }}/{{ item }}"
|
|
|
|
|
+ state: directory
|
|
|
|
|
+ owner: "{{ sensu_user_name }}"
|
|
|
|
|
+ group: "{{ sensu_group_name }}"
|
|
|
|
|
+ recurse: true
|
|
|
|
|
+ with_items:
|
|
|
|
|
+ - etc
|
|
|
|
|
+ - go
|
|
|
|
|
+
|
|
|
|
|
+ - name: Ensure Uchiwa GOPATH exists
|
|
|
|
|
+ file:
|
|
|
|
|
+ dest: "{{ uchiwa_path }}/go/{{ item }}"
|
|
|
|
|
+ owner: "{{ sensu_user_name }}"
|
|
|
|
|
+ group: "{{ sensu_group_name }}"
|
|
|
|
|
+ state: directory
|
|
|
|
|
+ recurse: true
|
|
|
|
|
+ with_items:
|
|
|
|
|
+ - bin
|
|
|
|
|
+ - pkg
|
|
|
|
|
+ - src
|
|
|
|
|
+
|
|
|
|
|
+ - name: Fetch Uchiwa from GitHub
|
|
|
|
|
+ command: go get github.com/sensu/uchiwa
|
|
|
|
|
+ environment:
|
|
|
|
|
+ GOPATH: "{{ uchiwa_path }}/go"
|
|
|
|
|
+ args:
|
|
|
|
|
+ creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
|
|
|
|
|
+ notify: Build and deploy Uchiwa
|
|
|
|
|
+ become: true
|
|
|
|
|
+ become_user: "{{ sensu_user_name }}"
|
|
|
|
|
+
|
|
|
|
|
+ - meta: flush_handlers
|
|
|
|
|
+
|
|
|
|
|
+ - name: Deploy Uchiwa config
|
|
|
|
|
+ template:
|
|
|
|
|
+ src: uchiwa_config.json.j2
|
|
|
|
|
+ dest: "{{ uchiwa_path }}/etc/config.json"
|
|
|
|
|
+ owner: "{{ sensu_user_name }}"
|
|
|
|
|
+ group: "{{ sensu_group_name }}"
|
|
|
|
|
+ notify: restart uchiwa service
|
|
|
|
|
+
|
|
|
|
|
+ - name: Deploy Uchiwa service file
|
|
|
|
|
+ template:
|
|
|
|
|
+ src: uchiwa_openbsd.j2
|
|
|
|
|
+ dest: "/usr/local/etc/rc.d/uchiwa"
|
|
|
|
|
+ mode: "0755"
|
|
|
|
|
+
|
|
|
|
|
+ - name: Ensure Uchiwa server service is running
|
|
|
|
|
+ service: name=uchiwa state=started enabled=yes
|