Bug 1597282 - openshift logging Ansible playbook installation while defining PVC manifest a match label selector should use value 'true' in quotes to avoid it to understandable as a Boolean value. [NEEDINFO]
Summary: openshift logging Ansible playbook installation while defining PVC manifest a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Logging
Version: 3.7.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 3.10.z
Assignee: Jeff Cantrill
QA Contact: Qiaoling Tang
URL:
Whiteboard:
Depends On:
Blocks: 1601605 1601606
TreeView+ depends on / blocked
 
Reported: 2018-07-02 13:17 UTC by giriraj rajawat
Modified: 2018-08-31 06:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Ansible template did not quote the value in the selector Consequence: Invalid JSON was produced Fix: Quote the selector value Result: Able to create a pvc with selector
Clone Of:
: 1601605 1601606 (view as bug list)
Environment:
Last Closed: 2018-08-31 06:18:10 UTC
jcantril: needinfo? (grajawat)


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2376 None None None 2018-08-31 06:18:51 UTC
Github openshift openshift-ansible pull 9221 None None None 2018-07-16 20:33:48 UTC

Description giriraj rajawat 2018-07-02 13:17:01 UTC
Description of problem:

Open shift logging installation via Ansible playbook with parameter openshift_logging_es_pv_selector={"logging-es":"true"} failed


Version-Release number of selected component (if applicable): 3.7 


How reproducible:

Host file entry:

openshift_logging_es_pv_selector={"logging-es":"true"}


Steps to Reproduce:
1. Inject openshift_logging_es_pv_selector={"logging-es":"true"} in Host file
2. ansible-playbook -i host /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/openshift-logging.yml


Actual results:
Installation successful 


Expected results:

"stderr": "Error from server (BadRequest): error when creating \"/tmp/openshift-logging-ansible-JGyENQ/templates/logging-es-pvc.yml\": PersistentVolumeClaim in version \"v1\" cannot be handled as a PersistentVolumeClaim: [pos 276]: json: expect char '\"' but got char '1'\n",


Additional info:

- Ansible create PVC manifest a match label selector value true without quotes.
- The value 'true' should be in quotes to avoid it to understandable as a Boolean value.

Comment 1 markv 2018-07-02 13:54:32 UTC
The same problem with numeric values

Comment 2 Jeff Cantrill 2018-07-11 20:46:40 UTC
Please provide the version of ansible where you saw this failure.

Comment 4 Qiaoling Tang 2018-08-23 03:03:58 UTC
Verified on logging-elasticsearch-v3.10.34-2
openshift-ansible-playbooks-3.10.34-1.git.0.48df172None.noarch
openshift-ansible-roles-3.10.34-1.git.0.48df172None.noarch
openshift-ansible-3.10.34-1.git.0.48df172None.noarch
openshift-ansible-docs-3.10.34-1.git.0.48df172None.noarch

Logging can deploy successfully with openshift_logging_es_pv_selector={"logging-es":"true"} set in inventory:

# oc get pv --show-labels
NAME            CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                            STORAGECLASS   REASON    AGE       LABELS
pv-logging-es   5Gi        RWO            Retain           Bound     openshift-logging/logging-es-0   gp2                      11m       failure-domain.beta.kubernetes.io/region=us-east-1,failure-domain.beta.kubernetes.io/zone=us-east-1d,logging-es=true,type=local
# oc get pv
NAME            CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                            STORAGECLASS   REASON    AGE
pv-logging-es   5Gi        RWO            Retain           Bound     openshift-logging/logging-es-0   gp2                      12m

# oc get pod
NAME                                      READY     STATUS    RESTARTS   AGE
logging-curator-1-6zss7                   1/1       Running   0          3m
logging-es-data-master-optex4nn-1-s4p76   2/2       Running   0          2m
logging-fluentd-5jnwt                     1/1       Running   0          2m
logging-fluentd-7274k                     1/1       Running   0          2m
logging-fluentd-lgftc                     1/1       Running   0          2m
logging-fluentd-nq9ld                     1/1       Running   0          2m
logging-fluentd-smsdd                     1/1       Running   0          2m
logging-kibana-1-88hx4                    2/2       Running   0          3m

Comment 6 openshift-github-bot 2018-08-30 18:05:02 UTC
Commits pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/77eb875241444ac29d03f6a82b459e7b24a93069
bug 1597282. Quote selector to make it valid json

https://github.com/openshift/openshift-ansible/commit/33d278ada1a6351fa787210c80981b8791b9eda1
Merge pull request #9222 from jcantrill/1597282_on_master

bug 1597282. Quote selector to make it valid json

Comment 7 errata-xmlrpc 2018-08-31 06:18:10 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-2018:2376


Note You need to log in before you can comment on or make changes to this bug.