Ansible: Fix package cache updates
[csit.git] / resources / tools / testbed-setup / ansible / roles / performance_tuning / tasks / main.yaml
index 3a8f35b..608d3e2 100644 (file)
@@ -1,11 +1,17 @@
 ---
 # file: roles/performance_tuning/tasks/main.yaml
 
+- Name: Update package cache (apt)
+  apt:
+    update_cache: yes
+    cache_valid_time: 3600
+  when:
+    - ansible_distribution|lower == 'ubuntu'
+
 - name: Performance Tuning - Install Distribution - Release - Machine Prerequisites
   package:
     name: "{{ packages | flatten(levels=1) }}"
     state: latest
-    update_cache: true
   tags:
     - install-dependencies
 
@@ -19,7 +25,7 @@
     path: "/etc/default/grub"
     state: "present"
     regexp: "^GRUB_CMDLINE_LINUX="
-    line: "{{ grub_cmdline_linux[ansible_machine] | join() }}"
+    line: "GRUB_CMDLINE_LINUX=\"{% for key, value in grub.items() %}{% if value %}{{key}}={{value}} {% else %}{{key}} {% endif %}{% endfor %}\""
   notify:
     - "Update GRUB"
   tags: