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(a)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