[ANSIBLE] Issue handling docker_no_proxy on Standard configs

Bug #1830091 reported by Jose Perez Carranza
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Tee Ngo

Bug Description

Brief Description
-----------------
When trying to configure a Standard system with proxies an error is retrieved that the format is wrong. Below is the localhost.yml format:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dns_servers:
  - <OUR INTERNAL DNS>

docker_http_proxy: <OUR INTERNAL PROXY>
docker_https_proxy:<OUR INTERNAL PROXY>
docker_no_proxy:
   - localhost
   - 127.0.0.1
   - 192.168.204.2
   - 192.168.204.3
   - 192.168.204.4
   - 10.10.10.3
   - 10.10.10.4
   - 10.10.10.5

external_oam_subnet: 10.10.10.0/24
external_oam_gateway_address: 10.10.10.1
external_oam_floating_address: 10.10.10.2
external_oam_node_0_address: 10.10.10.3
external_oam_node_1_address: 10.10.10.4
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Severity
--------
Provide the severity of the defect.
Critical

Steps to Reproduce
------------------
1- Install a Standard system
2- Use localhost.yml file described above to configure system using ANSIBLE

Expected Behavior
------------------
Configuration should be finished successfully

Actual Behavior
----------------
EROOR:
"cgtsclient.exc.HTTPBadRequest: Parameter 'no_proxy' includes an invalid address ''."

Reproducibility
---------------
Reproducible 100%

System Configuration
--------------------
Multi-node system

Branch/Pull Time/Commit
-----------------------
=========BUILD INFO =========
localhost:~$ cat /etc/build.info
###
### StarlingX
### Built from master
###

OS="centos"
SW_VERSION="19.01"
BUILD_TARGET="Host Installer"
BUILD_TYPE="Formal"
BUILD_ID="20190515T220331Z"

JOB="STX_build_master_master"
<email address hidden>"
BUILD_NUMBER="102"
BUILD_HOST="starlingx_mirror"
BUILD_DATE="2019-05-15 22:03:31 +0000"

http://mirror.starlingx.cengn.ca/mirror/starlingx/master/centos/20190515T220331Z/outputs/

Last Pass
---------
Not Tested before

Timestamp/Logs
--------------
2019-05-17 12:12:57,789 p=28100 u=wrsroot | TASK [persist-config : Saving config in sysinv database] **********************************************************************************************************************************************************
2019-05-17 12:13:01,428 p=28100 u=wrsroot | changed: [localhost]
2019-05-17 12:13:01,432 p=28100 u=wrsroot | TASK [persist-config : debug] *************************************************************************************************************************************************************************************
2019-05-17 12:13:01,453 p=28100 u=wrsroot | ok: [localhost] => {
    "populate_result": {
        "changed": true,
        "failed": false,
        "failed_when_result": false,
        "msg": "non-zero return code",
        "rc": 1,
        "stderr": "No handlers could be found for logger \"cgtsclient.common.http\"\nTraceback (most recent call last):\n File \"/tmp/.ansible-wrsroot/tmp/ansible-tmp-1558095177.81-169582223766860/populate_initial_config.py\", line 770, in <module>\n populate_docker_config(client)\n File \"/tmp/.ansible-wrsroot/tmp/ansible-tmp-1558095177.81-169582223766860/populate_initial_config.py\", line 446, in populate_docker_config\n client.sysinv.service_parameter.create(**values)\n File \"/usr/lib64/python2.7/site-packages/cgtsclient/v1/service_parameter.py\", line 42, in create\n return self._create(self._path(), body)\n File \"/usr/lib64/python2.7/site-packages/cgtsclient/common/base.py\", line 51, in _create\n _, body = self.api.json_request('POST', url, body=body)\n File \"/usr/lib64/python2.7/site-packages/cgtsclient/common/http.py\", line 243, in json_request\n method, **kwargs)\n File \"/usr/lib64/python2.7/site-packages/cgtsclient/common/http.py\", line 219, in _cs_request\n error_json.get('debuginfo'), *args)\ncgtsclient.exc.HTTPBadRequest: Parameter 'no_proxy' includes an invalid address ''.\n",
        "stderr_lines": [
            "No handlers could be found for logger \"cgtsclient.common.http\"",
            "Traceback (most recent call last):",
            " File \"/tmp/.ansible-wrsroot/tmp/ansible-tmp-1558095177.81-169582223766860/populate_initial_config.py\", line 770, in <module>",
            " populate_docker_config(client)",
            " File \"/tmp/.ansible-wrsroot/tmp/ansible-tmp-1558095177.81-169582223766860/populate_initial_config.py\", line 446, in populate_docker_config",
            " client.sysinv.service_parameter.create(**values)",
            " File \"/usr/lib64/python2.7/site-packages/cgtsclient/v1/service_parameter.py\", line 42, in create",
            " return self._create(self._path(), body)",
            " File \"/usr/lib64/python2.7/site-packages/cgtsclient/common/base.py\", line 51, in _create",
            " _, body = self.api.json_request('POST', url, body=body)",
            " File \"/usr/lib64/python2.7/site-packages/cgtsclient/common/http.py\", line 243, in json_request",
            " method, **kwargs)",
            " File \"/usr/lib64/python2.7/site-packages/cgtsclient/common/http.py\", line 219, in _cs_request",
            " error_json.get('debuginfo'), *args)",
            "cgtsclient.exc.HTTPBadRequest: Parameter 'no_proxy' includes an invalid address ''."
        ],
        "stdout": "Populating system config...\nPopulating load config...\nPopulating management network...\nPopulating pxeboot network...\nPopulating oam network...\nPopulating multicast network...\nPopulating cluster host network...\nPopulating cluster pod network...\nPopulating cluster service network...\nNetwork config completed.\nPopulating DNS config...\nPopulating docker config...\nFailed to update the initial system config.\n",
        "stdout_lines": [
            "Populating system config...",
            "Populating load config...",
            "Populating management network...",
            "Populating pxeboot network...",
            "Populating oam network...",
            "Populating multicast network...",
            "Populating cluster host network...",
            "Populating cluster pod network...",
            "Populating cluster service network...",
            "Network config completed.",
            "Populating DNS config...",
            "Populating docker config...",
            "Failed to update the initial system config."
        ]
    }
}
2019-05-17 12:13:01,457 p=28100 u=wrsroot | TASK [persist-config : Fail if populate config script throws an exception] ****************************************************************************************************************************************
2019-05-17 12:13:01,477 p=28100 u=wrsroot | fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to provision initial system configuration."}
2019-05-17 12:13:01,479 p=28100 u=wrsroot | PLAY RECAP ********************************************************************************************************************************************************************************************************
2019-05-17 12:13:01,479 p=28100 u=wrsroot | localhost : ok=123 changed=44 unreachable=0 failed=1

Test Activity
-------------
Test Suite migration to ANSIBLE

Revision history for this message
Ghada Khalil (gkhalil) wrote :

Marking as release gating; issue related to ansible deployment.

tags: added: stx.2.0 stx.config
Changed in starlingx:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Tee Ngo (teewrs)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/660795

Changed in starlingx:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/660795
Committed: https://git.openstack.org/cgit/starlingx/config/commit/?id=41a4d23b3f347ff59ec3d54320350e6971ba8102
Submitter: Zuul
Branch: master

commit 41a4d23b3f347ff59ec3d54320350e6971ba8102
Author: Tee Ngo <email address hidden>
Date: Wed May 22 13:34:43 2019 -0400

    Correctly validate docker_no_proxy config input

    This commit correctly sets the default docker_no_proxy list
    for duplex system mode and eliminates duplicates in the merged
    list.

    Tests:
      - Run bootstrap playbook with various custom docker_no_proxy
        lists (unique, with duplicates) for both simplex and duplex
        system modes.

    Closes-Bug: 1830091

    Change-Id: Ifd17c40a966170f66bcd8a2d6c91af8d73efdeb8
    Signed-off-by: Tee Ngo <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.