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

Bug 1319663

Summary: Docker options in ansible inventory file not working as expected
Product: OpenShift Container Platform Reporter: Alexander Koksharov <akokshar>
Component: InstallerAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED ERRATA QA Contact: Ma xiaoqiang <xiama>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: akokshar, aos-bugs, bleanhar, dgoodwin, jokerman, knakayam, mmccomas, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-ansible-3.0.82-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:38:57 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 Alexander Koksharov 2016-03-21 09:52:22 UTC
Description of problem:
ansible does not correctly apply docker options configured in inventory file.

1. does not work at all:
openshift_docker_options="-l warn --ipv6=false --log-opt max-size=1M --log-opt max-file=3"

2. does not work at all:
docker_log_options="--log-opt max-size=1M --log-opt max-file=3"
docker_options="--log-level=\"warn\""

3. does not work. Produce incorrect results for log options, do not apply log level at all.
cli_docker_log_options="max-size=1M max-file=3"
cli_docker_options="--log-level=\"warn\""

these settings produce the following line:
OPTIONS='--insecure-registry=172.30.0.0/16 --selinux-enabled --log-opt max-size=1M max-file=3'



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

How reproducible:
set options as above and run ansible playbook 

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:

Additional info:

Comment 1 Jason DeTiberus 2016-03-21 20:56:35 UTC
Are they using the packaged version of the playbooks, or are they using the version from the openshift-ansible repository?

I don't think we've shipped a version of atomic-openshift-utils to the 3.1 channel that supports the new openshift_docker_* variables (It will ship with 3.2 though).

Comment 2 Alexander Koksharov 2016-03-22 08:45:07 UTC
I have reproduced this issue on my test environment:
root@master # rpm -qa | grep -i atomic
atomic-openshift-utils-3.0.35-1.git.0.6a386dd.el7aos.noarch
atomic-openshift-clients-3.1.1.6-1.git.0.b57e8bd.el7aos.x86_64
atomic-openshift-master-3.1.1.6-1.git.0.b57e8bd.el7aos.x86_64
atomic-openshift-node-3.1.1.6-1.git.0.b57e8bd.el7aos.x86_64
atomic-openshift-sdn-ovs-3.1.1.6-1.git.0.b57e8bd.el7aos.x86_64
atomic-openshift-3.1.1.6-1.git.0.b57e8bd.el7aos.x86_64
tuned-profiles-atomic-openshift-node-3.1.1.6-1.git.0.b57e8bd.el7aos.x86_64

yes, new options "openshift_docker_* " do not work at all. But old ones work incorrectly:
  cli_docker_log_options="max-size=1M max-file=3"
  cli_docker_options="--log-level=\"warn\""
produced line:
  OPTIONS='--insecure-registry=172.30.0.0/16 --selinux-enabled --log-opt max-size=1M max-file=3'

Which is incorrect and prevent docker to start.

Comment 3 Devan Goodwin 2016-04-12 11:47:28 UTC
Hey Alexander, the code is using a "," as the default separator, so this should work:

cli_docker_log_options="max-size=1M,max-file=3"

However we're going to be migrating this to require a JSON list instead in the new openshift_docker_log_options setting. (This will not be backward compat with the old plain string value anymore)

Comment 4 Devan Goodwin 2016-04-12 14:14:34 UTC
PR is up here: https://github.com/openshift/openshift-ansible/pull/1742

Once this is merged and rebuilt, the new format for the log options will be:

openshift_docker_log_options=["max-size=1M", "max-file=3"]

Comment 5 Devan Goodwin 2016-04-20 19:03:26 UTC
PR now merged. The new list format, as well as the old comma separated string format are both supported, as are both openshift_docker_log_options and the legacy cli_docker_log_options.

Comment 7 Ma xiaoqiang 2016-04-22 02:28:01 UTC
check on openshift-ansible-3.0.82-1

scenarios 1
install env with following parameters
openshift_docker_log_options=["max-size=1M", "max-file=3"]
cli_docker_options="--log-level=\"warn\" --insecure-registry=192.168.0.0/16"

check the docker configuration
OPTIONS=' --selinux-enabled --log-opt max-size=1M --log-opt max-file=3 --insecure-registry=172.30.0.0/16 --log-level="warn" --insecure-registry=192.168.0.0/16'

set the correct value

Scenarios 2
Install env with the following parameters
cli_docker_log_options="max-size=1M, max-file=3"
openshift_docker_options="--log-level=\"warn\" --insecure-registry=192.168.0.0/16"

check the docker options
OPTIONS=' --selinux-enabled --log-opt max-size=1M --log-opt  max-file=3 --insecure-registry=172.30.0.0/16 --log-level="warn" --insecure-registry=192.168.0.0/16'

set the correct value.

Move this issue to VERIFIED.

Comment 9 errata-xmlrpc 2016-05-12 16:38:57 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-2016:1065

Comment 10 Kenjiro Nakayama 2016-05-19 07:30:30 UTC
(In reply to Devan Goodwin from comment #4)
> PR is up here: https://github.com/openshift/openshift-ansible/pull/1742
> 
> Once this is merged and rebuilt, the new format for the log options will be:
> 
> openshift_docker_log_options=["max-size=1M", "max-file=3"]

We don't need to update documentation? 

https://docs.openshift.com/enterprise/3.2/install_config/install/advanced_install.html#configuring-host-variables