[libvirt] [jenkins-ci PATCH] guests: Stop using search() as a filter

Andrea Bolognani posted 1 patch 5 years, 9 months ago
Failed in applying to current master (apply log)
guests/tasks/bootstrap.yml | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
[libvirt] [jenkins-ci PATCH] guests: Stop using search() as a filter
Posted by Andrea Bolognani 5 years, 9 months ago
Recent versions of Ansible complain about this, and suggest
to replace 'result|search' with 'result is search'.

Since f17097c7af59, however, we've been including operating
system information in the inventory: this allows us to drop
our use of search() entirely.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 guests/tasks/bootstrap.yml | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/guests/tasks/bootstrap.yml b/guests/tasks/bootstrap.yml
index 24848c8..d7abb86 100644
--- a/guests/tasks/bootstrap.yml
+++ b/guests/tasks/bootstrap.yml
@@ -2,21 +2,19 @@
 - name: Bootstrap the pkgng package manager
   raw: env ASSUME_ALWAYS_YES=YES pkg bootstrap
   when:
-    - inventory_hostname|search('freebsd')
+    - package_format == 'pkg'
 
 - name: Bootstrap Ansible
   raw: yum install -y python2
   when:
-    - ( inventory_hostname|search('centos') or
-        inventory_hostname|search('fedora') )
+    - package_format == 'rpm'
 
 - name: Bootstrap Ansible
   raw: apt-get install -y python
   when:
-    - ( inventory_hostname|search('debian') or
-        inventory_hostname|search('ubuntu') )
+    - package_format == 'deb'
 
 - name: Bootstrap Ansible
   raw: pkg install -y python2
   when:
-    - inventory_hostname|search('freebsd')
+    - package_format == 'pkg'
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH] guests: Stop using search() as a filter
Posted by Erik Skultety 5 years, 9 months ago
On Fri, Jul 13, 2018 at 10:56:56AM +0200, Andrea Bolognani wrote:
> Recent versions of Ansible complain about this, and suggest
> to replace 'result|search' with 'result is search'.
>
> Since f17097c7af59, however, we've been including operating
> system information in the inventory: this allows us to drop
> our use of search() entirely.
>
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>

Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list