Skip to content

Instantly share code, notes, and snippets.

@mtnbikenc
Created March 28, 2017 18:12
Show Gist options
  • Select an option

  • Save mtnbikenc/fd96578b52f226e89a17671624f2f20e to your computer and use it in GitHub Desktop.

Select an option

Save mtnbikenc/fd96578b52f226e89a17671624f2f20e to your computer and use it in GitHub Desktop.
Bad Example
---
# NOTE: requires openshift_facts be run
- name: Verify compatible yum/subscription-manager combination
hosts: l_oo_all_hosts
gather_facts: no
tasks:
# See:
# https://bugzilla.redhat.com/show_bug.cgi?id=1395047
# https://bugzilla.redhat.com/show_bug.cgi?id=1282961
# https://github.com/openshift/openshift-ansible/issues/1138
- name: Check for bad combinations of yum and subscription-manager
command: >
{{ repoquery_cmd }} --installed --qf '%{version}' "yum"
register: yum_ver_test
changed_when: false
when: not openshift.common.is_atomic | bool
- fail:
msg: Incompatible versions of yum and subscription-manager found. You may need to update yum and yum-utils.
when: "not openshift.common.is_atomic | bool and 'Plugin \"search-disabled-repos\" requires API 2.7. Supported API is 2.6.' in yum_ver_test.stdout"
# TODO(jchaloup): find a different way how to make repoquery --qf '%version` atomic-openshift work without disabling the excluders
- include: disable_excluder.yml
vars:
# the excluders needs to be disabled no matter what status says
with_status_check: false
# Only openshift excluder needs to be temporarily disabled
# So ignore the docker one
enable_docker_excluder: false
tags:
- always
when: openshift_upgrade_target is not defined
- name: Determine openshift_version to configure on first master
hosts: oo_first_master
roles:
- openshift_version
# NOTE: We set this even on etcd hosts as they may also later run as masters,
# and we don't want to install wrong version of docker and have to downgrade
# later.
- name: Set openshift_version for all hosts
hosts: oo_all_hosts:!oo_first_master
vars:
openshift_version: "{{ hostvars[groups.oo_first_master.0].openshift_version }}"
roles:
- openshift_version
# Re-enable excluders if they are meant to be enabled (and only during installation, upgrade disables the excluders before this play)
- include: reset_excluder.yml
vars:
# Only openshift excluder needs to be re-enabled
# So ignore the docker one
enable_docker_excluder: false
tags:
- always
when: openshift_upgrade_target is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment