Przeglądaj źródła

Moving Uchiwa build/deploy to handler

cmacrae 9 lat temu
rodzic
commit
947cbc16b5
2 zmienionych plików z 16 dodań i 15 usunięć
  1. 7 0
      handlers/main.yml
  2. 9 15
      tasks/SmartOS/dashboard.yml

+ 7 - 0
handlers/main.yml

@@ -27,3 +27,10 @@
   
   - name: import uchiwa service
     command: /usr/sbin/svccfg import /opt/local/lib/svc/manifest/uchiwa.xml
+
+  - name: Build and deploy Uchiwa
+    shell: npm install --production
+    args:
+      chdir: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
+    become: true
+    become_user: "{{ sensu_user_name }}"

+ 9 - 15
tasks/SmartOS/dashboard.yml

@@ -38,24 +38,18 @@
       - pkg
       - src
 
-  - block:
-
-    - 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"
-
-    - name: Build and deploy Uchiwa
-      shell: npm install --production
-      args:
-        chdir: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa"
-        creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa/public/bower_components"
-
+  - 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