Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1612142

Summary: The openshift-ansible shouldn't import v3.7 examples and host templates in v3.9
Product: OpenShift Container Platform Reporter: Anping Li <anli>
Component: InstallerAssignee: Russell Teague <rteague>
Status: CLOSED ERRATA QA Contact: Anping Li <anli>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.9.0CC: aos-bugs, gpei, jokerman, mmccomas, rteague, wzheng
Target Milestone: ---Keywords: Triaged
Target Release: 3.9.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The openshift_facts Ansible module was improperly setting internal variables used for installing examples and templates. The boolean logic has been updated to correctly identify the current version being installed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-30 15:10:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anping Li 2018-08-03 15:06:02 UTC
Description of problem:
The v3.7 examples files and host templated were installed by openshift-ansible. 


Version-Release number of the following components:
openshift-ansible-3.9.40-1.git.0.188c954.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Deploy openshift
2. #oc get dc registry-console -o json |grep image
                 "image": "registry.access.xxx.redhat.com/openshift3/registry-console:v3.7",
3. # cat /etc/origin/hosted/registry-console.yaml  |grep -A 1 "name: IMAGE_VERSION"
    name: IMAGE_VERSION
    value: "v3.7"
4. check the ansible logs
 TASK [openshift_examples : Create tar of OpenShift examples] ******************************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/openshift_examples/tasks/main.yml:23
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: anli
<localhost> EXEC /bin/sh -c 'echo ~anli && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/anli/.ansible/tmp/ansible-tmp-1533306898.15-21158297001105 `" && echo ansible-tmp-1533306898.15-21158297001105="` echo /home/anli/.ansible/tmp/ansible-tmp-1533306898.15-21158297001105 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
<localhost> PUT /home/anli/.ansible/tmp/ansible-local-20840meX57E/tmpymJEMW TO /home/anli/.ansible/tmp/ansible-tmp-1533306898.15-21158297001105/command.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/anli/.ansible/tmp/ansible-tmp-1533306898.15-21158297001105/ /home/anli/.ansible/tmp/ansible-tmp-1533306898.15-21158297001105/command.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python2 /home/anli/.ansible/tmp/ansible-tmp-1533306898.15-21158297001105/command.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/anli/.ansible/tmp/ansible-tmp-1533306898.15-21158297001105/ > /dev/null 2>&1 && sleep 0'
changed: [host-8-241-199.host.centralci.eng.rdu2.redhat.com -> localhost] => {
    "changed": true,
    "cmd": [
        "tar",
        "-C",
        "/usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.7/",
        "-cvf",
        "/tmp/openshift-ansible-uuag81z/openshift-examples.tar",
        "."
    ],
    "delta": "0:00:00.067604",
    "end": "2018-08-03 10:34:58.326015",
    "invocation": {
        "module_args": {
            "_raw_params": "tar -C \"/usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.7/\" -cvf \"/tmp/openshift-ansible-uuag81z/openshift-examples.tar\" .",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "warn": false
        }
    },
    "rc": 0,
    "start": "2018-08-03 10:34:58.258411",
    "stderr": "",
    "stderr_lines": [],


Actual results:
The v3.7 example files and host template are copied and imported by openshift

Expected results:
v3.9 example files and templates are imported


Additional info:

Comment 2 Anping Li 2018-08-06 07:13:32 UTC
Provide a workaround
1) oc delete is -n openshift
2) oc delete template -n openshift
3) Delete template file on your first master
  For Atomic,  rm -rf /etc/origin/hosted /etc/origin/examples
  For RHEL, 
4) Run playbook
ansible-playbook -i hosts /usr/share/ansible/openshift-ansible/playbooks/openshift-master/additional_config.yml

5) Run playbook
ansible-playbook -i hosts /usr/share/ansible/openshift-ansible/playbooks/openshift-hosted/config.yml

Comment 4 Anping Li 2018-08-07 01:42:45 UTC
@scott, Yes, the webconsole is started using v3.7 image. the template and imagestream works.

Comment 5 Anping Li 2018-09-19 06:22:44 UTC
Provide an updated workaround base on comment2 
1) oc delete is --all -n openshift
2) oc delete template --all -n openshift
3) Delete template file on your first master
  For Atomic,  rm -rf /etc/origin/hosted  /etc/origin/examples
  For RHEL,  rm -rf /usr/share/openshift/ /usr/share/openshift/hosted
4) Run playbook
ansible-playbook -i hosts /usr/share/ansible/openshift-ansible/playbooks/openshift-master/additional_config.yml

Comment 6 Wenjing Zheng 2018-09-19 06:32:16 UTC
@scott, it is better to fix this since jenkins imagestream may have version compatibility issue, that's why jenkins image has OCP version tag after v3.6(it has oc plugin which only support N+1/N-1), so pointing Jenkins to v3.7 in v3.9 may have risk.

So I am raising this bug severity to medium.

From openshift imagestream:
2 (latest)
  tagged from registry.access.stage.redhat.com/openshift3/jenkins-2-rhel7:v3.9

  Provides a Jenkins 2.X server on RHEL 7. For more information about using this container image, including OpenShift considerations, see https://github.com/openshift/jenkins/blob/master/README.md.
  Tags: jenkins

  * registry.access.stage.redhat.com/openshift3/jenkins-2-rhel7@sha256:45453170e8aedb2648e8ac67d65c435f2c32d7d4c09a1ea4e193e18233d7f3d2
      22 minutes ago

Comment 7 Russell Teague 2018-11-16 21:51:56 UTC
Proposed: https://github.com/openshift/openshift-ansible/pull/10714

Comment 8 Russell Teague 2018-11-19 15:29:53 UTC
Waiting for build
$ git tag --contains f97b5ae838ea467d52ef54e7587037367a8a3b50

Comment 9 Russell Teague 2018-11-26 14:36:58 UTC
Fixed in openshift-ansible-3.9.54-1

Comment 10 Anping Li 2018-12-21 09:26:16 UTC
it works on openshift-ansible-3.9.61

Comment 12 errata-xmlrpc 2019-01-30 15:10:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0098