---
# NOTE: requires openshift_facts be run
- 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

---
# NOTE: requires openshift_facts be run
- 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 }}"
  pre_tasks:
  - set_fact:
      openshift_pkg_version: -{{ openshift_version }}
    when: openshift_pkg_version is not defined
  - debug: msg="openshift_pkg_version set to {{ openshift_pkg_version }}"
  roles:
  - openshift_version

Fix rpm version logic for hosts
Fix rpm version logic for hosts

Currently, the variable openshift_pkg_version is defined
by the first master unless specified by the user.  The role
openshift_version attempts to set this value on all other
hosts after setting it on the first master.

During normal installation, openshift_pkg_version is not
initially defined, therefor each host will utilize the
most recent rpm available.  This creates a problem
during later operations of a cluster if a node is added
or replaced by a new node.

This commit ensures that the value for openshift_pkg_version
set by the first master is respected by subsequent hosts.

Fixes: #5341
