xci: Add missing update_cache statements 75/64375/1
authorMarkos Chandras <mchandras@suse.de>
Thu, 1 Nov 2018 09:55:48 +0000 (09:55 +0000)
committerMarkos Chandras <mchandras@suse.de>
Thu, 1 Nov 2018 09:57:29 +0000 (09:57 +0000)
When we install packages from the distro repos we need to make sure
that the database is updated. This also takes SUSE's zypper pkg manager
into consideration which can benefit from the same Ansible option.

Change-Id: I7a2206bfc5827b9ccb448278759711c560bb4679
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/installer/kubespray/playbooks/configure-opnfvhost.yml
xci/installer/kubespray/playbooks/configure-targethosts.yml
xci/playbooks/roles/create-nodes/tasks/main.yml
xci/playbooks/roles/prepare-tests/tasks/main.yml

index 82ece96..54e3214 100644 (file)
@@ -82,7 +82,7 @@
       package:
         name: "{{ (ansible_pkg_mgr == 'zypper') | ternary('dbus-1', 'dbus') }}"
         state: present
-        update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
+        update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
       when: xci_flavor == 'aio'
 
     - name: change dashboard server type to NodePort
index 859460c..2fde987 100644 (file)
@@ -22,7 +22,7 @@
       package:
         name: "{{ (ansible_pkg_mgr == 'zypper') | ternary('dbus-1', 'dbus') }}"
         state: present
-        update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
+        update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
 
 - hosts: kube-master
   remote_user: root
index 0e51b41..8e54fcd 100644 (file)
@@ -8,6 +8,8 @@
 - name: "Install required packages"
   package:
     name: "{{ required_packages }}"
+    update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
+    state: present
 
 - include_tasks: prepare_libvirt.yml
   with_items: "{{ libvirt_networks }}"
index b4e566c..a543ac1 100644 (file)
@@ -11,6 +11,7 @@
 - name: install required packages
   package:
     name: "{{ required_packages[ansible_pkg_mgr] }}"
+    update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
     state: present
 
 # Docker is needed for test frameworks