[libvirt] [jenkins-ci PATCH v2 1/5] guests: Shuffle base steps around

Andrea Bolognani abologna at redhat.com
Mon Oct 23 13:19:00 UTC 2017


We want to add extra repositories before updating the installed
packages; however, adding extra repositories might require the
libselinux-python package to be installed on some systems.

Reorder the steps so that the libselinux-python package is installed
before adding extra repositories, which in turn happens before
updating installed packages.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 guests/tasks/base.yml | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml
index 572da9d..798d7cd 100644
--- a/guests/tasks/base.yml
+++ b/guests/tasks/base.yml
@@ -33,6 +33,30 @@
     - ( os_name == 'CentOS' or
         os_name == 'Fedora' )
 
+- name: Bootstrap the package module
+  command: apt-get install -y python-apt
+  args:
+    creates: /usr/lib/python2*/*-packages/apt
+    warn: no
+  when:
+    - package_format == 'deb'
+
+- name: Bootstrap the package module
+  command: dnf install -y python2-dnf
+  args:
+    creates: /usr/lib*/python2*/*-packages/dnf
+    warn: no
+  when:
+    - os_name == 'Fedora'
+
+- name: Permit file editing on SELinux-enabled systems
+  package:
+    name: libselinux-python
+    state: present
+  when:
+    - ( os_name == 'CentOS' or
+        os_name == 'Fedora' )
+
 - name: Enable jessie-backports repository
   copy:
     src: files/jessie-backports.sources
@@ -53,22 +77,6 @@
     - os_name == 'Debian'
     - os_version == '8'
 
-- name: Bootstrap the package module
-  command: apt-get install -y python-apt
-  args:
-    creates: /usr/lib/python2*/*-packages/apt
-    warn: no
-  when:
-    - package_format == 'deb'
-
-- name: Bootstrap the package module
-  command: dnf install -y python2-dnf
-  args:
-    creates: /usr/lib*/python2*/*-packages/dnf
-    warn: no
-  when:
-    - os_name == 'Fedora'
-
 - name: Update installed packages
   package:
     name: '*'
@@ -106,14 +114,6 @@
   with_items:
     - nano
 
-- name: Permit file editing on SELinux-enabled systems
-  package:
-    name: libselinux-python
-    state: present
-  when:
-    - ( os_name == 'CentOS' or
-        os_name == 'Fedora' )
-
 - name: Configure hostname
   hostname:
     name: '{{ inventory_hostname }}'
-- 
2.13.6




More information about the libvir-list mailing list