Bug 1465168

Summary: mux doesn't recognize ansible boolean parameters correctly
Product: OpenShift Container Platform Reporter: Rich Megginson <rmeggins>
Component: LoggingAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Xia Zhao <xiazhao>
Severity: high Docs Contact:
Priority: high    
Version: 3.6.0CC: aos-bugs, jcantril, nhosoi, pportant, xtian
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 21:58:46 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 Rich Megginson 2017-06-26 21:07:22 UTC
Description of problem:
If you have an ansible inventory file like this:

openshift_logging_mux_allow_external=True

or a vars.yaml like this:

ansible-playbook -e openshift_logging_mux_allow_external=True

The MUX_ALLOW_EXTERNAL env. var. in the mux dc gets set to "True" and the fluentd/run.sh doesn't recognize it as a true value.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Noriko Hosoi 2017-06-27 06:16:35 UTC
Do we need something like this to lower the case?
diff --git a/fluentd/run.sh b/fluentd/run.sh
index 7bfeecb..f259681 100644
--- a/fluentd/run.sh
+++ b/fluentd/run.sh
@@ -26,6 +26,11 @@ docker_uses_journal() {
     return 1
 }
 
+MUX_ALLOW_EXTERNAL="${MUX_ALLOW_EXTERNAL,,}"
+USE_MUX="${USE_MUX,,}"
+USE_JOURNAL="${USE_JOURNAL,,}"
+USE_MUX_CLIENT="${USE_MUX_CLIENT,,}"
+

How about ES_COPY and ENABLE_MONITOR_AGENT?  They need to be converted, too?

Comment 3 openshift-github-bot 2017-06-28 15:16:06 UTC
Commits pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/e6cfe56298b804839ddbcb091113584e7902bf76
Bug 1465168 - mux doesn't recognize ansible boolean parameters correctly

https://bugzilla.redhat.com/show_bug.cgi?id=1465168
The fix is to pass the value through the `lower` filter.  The value is
set in defaults/main.yaml so it should always have a value.

https://github.com/openshift/openshift-ansible/commit/9613d2e517ced0bc5d165801df3442ab331d214c
Merge pull request #4591 from richm/bug-1465168

Bug 1465168 - mux doesn't recognize ansible boolean parameters correctly

Comment 5 Xia Zhao 2017-07-05 06:06:11 UTC
It's fixed, tested with 

# rpm -qa | grep ansible
openshift-ansible-callback-plugins-3.6.133-1.git.0.950bb48.el7.noarch
openshift-ansible-docs-3.6.133-1.git.0.950bb48.el7.noarch
openshift-ansible-lookup-plugins-3.6.133-1.git.0.950bb48.el7.noarch
openshift-ansible-filter-plugins-3.6.133-1.git.0.950bb48.el7.noarch
openshift-ansible-playbooks-3.6.133-1.git.0.950bb48.el7.noarch
ansible-2.2.3.0-1.el7.noarch
openshift-ansible-3.6.133-1.git.0.950bb48.el7.noarch
openshift-ansible-roles-3.6.133-1.git.0.950bb48.el7.noarch

Setting openshift_logging_mux_allow_external=True in the inventory file and after deployment, env variable MUX_ALLOW_EXTERNAL is set to true:

logging        logging-curator-1-52p3r                   1/1       Running     0          1m
logging        logging-es-data-master-176t9ksa-1-5s8lv   1/1       Running     0          1m
logging        logging-fluentd-22lbw                     1/1       Running     0          1m
logging        logging-fluentd-rgwm1                     1/1       Running     0          1m
logging        logging-kibana-1-2lcjv                    2/2       Running     0          1m
logging        logging-mux-1-3j553                       1/1       Running     0          1m


# oc rsh logging-mux-1-3j553
sh-4.2# env | grep MUX_ALLOW_EXTERNAL     
MUX_ALLOW_EXTERNAL=true

Comment 9 errata-xmlrpc 2017-11-28 21:58:46 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