EGI-Federation / fedcloud-dashboard

Common dashboard for the EGI Cloud Compute service
MIT License
3 stars 2 forks source link

Force rebuild and restart of containers #20

Closed enolfc closed 2 years ago

enolfc commented 2 years ago

Summary

Forces restart and reload of the service so we get the latest and greatest version always

Also download latest python3.10 image so we get updates in time.


Related issue : #19

enolfc commented 2 years ago

Of course, deploy fails because I used a fork :(

sebastian-luna-valero commented 2 years ago

Apologies I had no time to reply yesterday. I was thinking more about using a handler:

$ git diff
diff --git a/deployment/playbook.yaml b/deployment/playbook.yaml
index 8554584..3b2fe33 100644
--- a/deployment/playbook.yaml
+++ b/deployment/playbook.yaml
@@ -23,6 +23,8 @@
       repo: 'https://github.com/EGI-Federation/fedcloud-dashboard.git'
       version: "{{ git_ref }}"
       dest: /fedcloud-dashboard
+    notify:
+      - Restart dashboard

   - name: env file
     ansible.builtin.copy:
@@ -34,7 +36,7 @@
     ansible.builtin.copy:
       content: |
         #
-        # This manages the cloudkeeper OS backend
+        # This systemd unit manages the dashboard service
         #
         [Unit]
         Description=Dashboard
@@ -58,3 +60,9 @@
       enabled: yes
       state: started
       daemon_reload: yes
+
+  handlers:
+    - name: Restart dashboard
+      ansible.builtin.systemd:
+        name: dashboard.service
+        state: restarted

but your change should do it as well, thanks!

enolfc commented 2 years ago

Apologies I had no time to reply yesterday. I was thinking more about using a handler

Not so much familiar with handlers so didn't think of them. Would you submit a PR?

sebastian-luna-valero commented 2 years ago

It's working fine with your change, so I prefer to add a handler later on if we think it's useful. Thanks!