summaryrefslogtreecommitdiffstats
path: root/roles/openshift_excluder
diff options
context:
space:
mode:
authorJan Chaloupka <jchaloup@redhat.com>2017-05-02 13:21:51 +0200
committerJan Chaloupka <jchaloup@redhat.com>2017-05-11 13:42:20 +0200
commit13b58846f6c595c9530fe49e3a00ed6f3f42a896 (patch)
treef04f15529aaab4fa22a15a9096842fd4835bcca5 /roles/openshift_excluder
parent87c282b612ee53441e7564f53ac49a1a6624d820 (diff)
downloadopenshift-13b58846f6c595c9530fe49e3a00ed6f3f42a896.tar.gz
openshift-13b58846f6c595c9530fe49e3a00ed6f3f42a896.tar.bz2
openshift-13b58846f6c595c9530fe49e3a00ed6f3f42a896.tar.xz
openshift-13b58846f6c595c9530fe49e3a00ed6f3f42a896.zip
Extend repoquery command (of lib_utils role) to ignore excluders
Diffstat (limited to 'roles/openshift_excluder')
-rw-r--r--roles/openshift_excluder/README.md13
-rw-r--r--roles/openshift_excluder/meta/main.yml1
-rw-r--r--roles/openshift_excluder/tasks/verify_excluder.yml24
3 files changed, 24 insertions, 14 deletions
diff --git a/roles/openshift_excluder/README.md b/roles/openshift_excluder/README.md
index e048bd107..df45c28bf 100644
--- a/roles/openshift_excluder/README.md
+++ b/roles/openshift_excluder/README.md
@@ -25,16 +25,19 @@ None
Dependencies
------------
+- openshift_facts
+- openshift_repos
+- lib_utils
Tasks to include
----------------
-- exclude: enable excluders (assuming excluders are installed)
-- unexclude: disable excluders (assuming excluders are installed)
+- exclude: enable excluders
+- unexclude: disable excluders
- install: install excluders (installation is followed by excluder enabling)
-- enable: enable excluders (optionally with installation step)
-- disabled: disable excluders (optionally with installation and status step, the status check that can override which excluder gets enabled/disabled)
-- status: determine status of excluders
+- enable: enable excluders (install excluder(s) if not installed)
+- disabled: disable excluders (install excluder(s) if not installed)
+
Example Playbook
----------------
diff --git a/roles/openshift_excluder/meta/main.yml b/roles/openshift_excluder/meta/main.yml
index 4d1c1efca..c6081cdb2 100644
--- a/roles/openshift_excluder/meta/main.yml
+++ b/roles/openshift_excluder/meta/main.yml
@@ -14,3 +14,4 @@ galaxy_info:
dependencies:
- { role: openshift_facts }
- { role: openshift_repos }
+- { role: lib_utils }
diff --git a/roles/openshift_excluder/tasks/verify_excluder.yml b/roles/openshift_excluder/tasks/verify_excluder.yml
index 24a05d56e..aebdb8c58 100644
--- a/roles/openshift_excluder/tasks/verify_excluder.yml
+++ b/roles/openshift_excluder/tasks/verify_excluder.yml
@@ -5,15 +5,21 @@
# - openshift_upgrade_target
- block:
- name: Get available excluder version
- command: >
- {{ repoquery_cmd }} --qf '%{version}' "{{ excluder }}"
- register: excluder_version
- failed_when: false
- changed_when: false
+ repoquery:
+ name: "{{ excluder }}"
+ ignore_excluders: true
+ register: excluder_out
+
+ - fail:
+ msg: "Package {{ excluder }} not found"
+ when: not excluder_out.results.package_found
+
+ - set_fact:
+ excluder_version: "{{ excluder_out.results.versions.available_versions.0 }}"
- name: "{{ excluder }} version detected"
debug:
- msg: "{{ excluder }}: {{ excluder_version.stdout }}"
+ msg: "{{ excluder }}: {{ excluder_version }}"
- name: Printing upgrade target version
debug:
@@ -21,9 +27,9 @@
- name: Check the available {{ excluder }} version is at most of the upgrade target version
fail:
- msg: "Available {{ excluder }} version {{ excluder_version.stdout }} is higher than the upgrade target version"
+ msg: "Available {{ excluder }} version {{ excluder_version }} is higher than the upgrade target version"
when:
- - "{{ excluder_version.stdout != '' }}"
- - "{{ excluder_version.stdout.split('.')[0:2] | join('.') | version_compare(openshift_upgrade_target.split('.')[0:2] | join('.'), '>', strict=True) }}"
+ - "{{ excluder_version != '' }}"
+ - "{{ excluder_version.split('.')[0:2] | join('.') | version_compare(openshift_upgrade_target.split('.')[0:2] | join('.'), '>', strict=True) }}"
when:
- not openshift.common.is_atomic | bool