Bug 1509782

Summary: openshift_prometheus_image_prefix did not use the default value if not set it in inventory
Product: OpenShift Container Platform Reporter: Junqi Zhao <juzhao>
Component: InstallerAssignee: Michael Gugino <mgugino>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.7.0CC: aos-bugs, jeder, jokerman, mgugino, mmccomas, wsun, xtian
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: aos-scalability-37
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 22:21:49 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 Junqi Zhao 2017-11-06 03:28:41 UTC
Description of problem:
Did not set openshift_prometheus_image_prefix in inventory file and deployed prometheus, job failed at 'openshift_prometheus_image_prefix' is undefined", it did not take the default value "registry.access.redhat.com/openshift3/".

Error:
********************************************************************************
fatal: [host-8-242-139.host.centralci.eng.rdu2.redhat.com]: FAILED! => {
    "failed": true, 
    "msg": "The task includes an option with an undefined variable. The error was: 'openshift_prometheus_image_prefix' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_prometheus/tasks/main.yaml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set image facts\n  ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'openshift_prometheus_image_prefix' is undefined"
}
	to retry, use: --limit @/usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/openshift-prometheus.retry
********************************************************************************

Version-Release number of the following components:
# rpm -qa | grep openshift-ansible
openshift-ansible-lookup-plugins-3.7.0-0.191.0.git.0.bc2ff60.el7.noarch
openshift-ansible-playbooks-3.7.0-0.191.0.git.0.bc2ff60.el7.noarch
openshift-ansible-filter-plugins-3.7.0-0.191.0.git.0.bc2ff60.el7.noarch
openshift-ansible-callback-plugins-3.7.0-0.191.0.git.0.bc2ff60.el7.noarch
openshift-ansible-roles-3.7.0-0.191.0.git.0.bc2ff60.el7.noarch
openshift-ansible-docs-3.7.0-0.191.0.git.0.bc2ff60.el7.noarch
openshift-ansible-3.7.0-0.191.0.git.0.bc2ff60.el7.noarch

images:
prometheus-alert-buffer/images/v3.7.0-0.194.0.0
prometheus-alertmanager/images/v3.7.0-0.194.0.0
oauth-proxy/images/v3.7.0-0.194.0.0
prometheus/images/v3.7.0-0.194.0.0

How reproducible:
Always

Steps to Reproduce:
1. Deploy prometheus, inventory file see the [Additional info] part
2.
3.

Actual results:
Throw out errof 'openshift_prometheus_image_prefix' is undefined"

Expected results:
Should not be error throw out

Additional info:
[OSEv3:children]
masters
etcd


[masters]
${MASTER} openshift_public_hostname=${MASTER}

[etcd]
${ETCD} openshift_public_hostname=${ETCD}



[OSEv3:vars]
ansible_ssh_user=root
ansible_ssh_private_key_file="~/libra.pem"
deployment_type=openshift-enterprise

# prometheus
openshift_prometheus_state=present
openshift_prometheus_namespace=prometheus

openshift_prometheus_replicas=1
openshift_prometheus_node_selector={'role': 'node'}

Comment 1 Michael Gugino 2017-11-07 18:21:09 UTC
PR Created: https://github.com/openshift/openshift-ansible/pull/6036

Comment 3 Junqi Zhao 2017-11-08 01:55:06 UTC
We need new openshift-ansible build to verify this defect, the latest openshift-ansible version is openshift-ansible-3.7.0-0.197.0, it does not contain the fix.

But I used packages from master branch, issue is fixed.
Will verify this defect when we get the openshift-ansible packages contain this fix.

Comment 4 Xiaoli Tian 2017-11-09 03:22:59 UTC
Please test it on build 3.7.4-1 or newer version.

Comment 5 Junqi Zhao 2017-11-09 05:40:22 UTC
openshift_prometheus_image_prefix would use the default value "registry.access.redhat.com/openshift3/"  if not set it in inventory, no error threw out during the deployment.


# rpm -qa | grep openshift-ansible
openshift-ansible-playbooks-3.7.4-1.git.0.254e849.el7.noarch
openshift-ansible-filter-plugins-3.7.4-1.git.0.254e849.el7.noarch
openshift-ansible-lookup-plugins-3.7.4-1.git.0.254e849.el7.noarch
openshift-ansible-callback-plugins-3.7.4-1.git.0.254e849.el7.noarch
openshift-ansible-3.7.4-1.git.0.254e849.el7.noarch
openshift-ansible-roles-3.7.4-1.git.0.254e849.el7.noarch
openshift-ansible-docs-3.7.4-1.git.0.254e849.el7.noarch

# openshift version
openshift v3.7.0-0.198.0
kubernetes v1.7.6+a08f5eeb62
etcd 3.2.8

Comment 8 errata-xmlrpc 2017-11-28 22:21:49 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/RHSA-2017:3188