Ansible: Fix package cache updates
[csit.git] / resources / tools / testbed-setup / ansible / roles / nomad / tasks / main.yaml
index a8bf90f..5b32305 100644 (file)
@@ -1,11 +1,17 @@
 ---
 # file: roles/nomad/tasks/main.yaml
 
+- Name: Update package cache (apt)
+  apt:
+    update_cache: yes
+    cache_valid_time: 3600
+  when:
+    - ansible_distribution|lower == 'ubuntu'
+
 - name: Inst - Prerequisites
   package:
     name: "{{ packages | flatten(levels=1) }}"
     state: latest
-    update_cache: true
   tags:
     - nomad-inst-prerequisites
 
   tags:
     - nomad-conf-user
 
+- name: Inst - Clean Nomad
+  file:
+    path: "{{ nomad_inst_dir }}/nomad"
+    state: "absent"
+  tags:
+    - nomad-inst-package
+
 - name: Inst - Download Nomad
   get_url:
     url: "{{ nomad_zip_url }}"
   tags:
     - nomad-inst-package
 
-- name: Inst - Cleanup
-  file:
-    path: "{{ nomad_inst_dir }}/nomad"
-    state: "absent"
-  tags:
-    - nomad-inst-package
-
 - name: Conf - Create Directories "{{ nomad_data_dir }}"
   file:
     dest: "{{ nomad_data_dir }}"