Browse Source

Fix missing openshift.common.version fact on containerized nodes.

Devan Goodwin 8 years ago
parent
commit
bcf414e8b5

+ 2 - 0
playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml

@@ -107,7 +107,9 @@
   hosts: oo_nodes_to_config
   roles:
   - openshift_facts
+  - openshift_docker_facts
   tasks:
+  - debug: var=openshift.docker.openshift_version
   - name: Ensure Node is running
     service:
       name: "{{ openshift.common.service_type }}-node"

+ 3 - 0
roles/openshift_facts/library/openshift_facts.py

@@ -1138,6 +1138,9 @@ def get_openshift_version(facts):
         # and is falsely acting like openshift is already installed
         _, output, _ = module.run_command(['/usr/local/bin/openshift', 'version'])
         version = parse_openshift_version(output)
+    elif 'node' in facts and 'common' in facts and 'is_containerized' in facts['common']:
+        _, output, _ = module.run_command(['docker', 'run', '--rm', facts['common']['cli_image'], 'version'])
+        version = parse_openshift_version(output)
 
     return version