Code that creates localhost_override_backup.yml will take the no_proxy list from the DB:
for docker in docker_list:
# Get the docker no-proxy info if it exists
if docker.name == constants.SERVICE_PARAM_NAME_DOCKER_NO_PROXY:
# Remove the open and close parenthesis if address is IPV6 _value = docker.value.strip("[]") no_proxy_list = _value.split(',') data.update({'docker_no_proxy': no_proxy_list})
Problem is that the original list of custom no_proxy registries used at configuration in localhost.yml is:
docker_no_proxy:
- registry.local
- tis-lab-registry.cumulus.wrs.com
Which ansible bootstrap writes to sysinv as:
localhost,127.0.0.1,registry.local,[abcd:204::1],[abcd:204::2],[2620:10a:a001:a103::1237],[2620:10a:a001:a103::1235],[abcd:204::3],[2620:10a:a001:a103::1236],tis-lab-registry.cumulus.wrs.com
That's because ansible appends the two custom ones to a default list in:
- name: Add user defined no-proxy address list to default
set_fact: docker_no_proxy_combined: "{{ default_no_proxy | union(docker_no_proxy) | unique | ipwrap }}"
This means that at restore the list of defaults entries will be doubled, which leads to a string that is too long (hence the "The service parameter value is restricted to at most 255 characters." error).
Two possible solutions here:
A. Do not write the default values to localhost_override_backup.yml or
B. Do not append the default values to the docker_no_proxy_combined list whne mode == 'restore' with something like:
- name: Add user defined no-proxy address list to default
set_fact: docker_no_proxy_combined: "{{ default_no_proxy | union(docker_no_proxy) | unique | ipwrap }}"
when: mode != 'restore'
- name: Add user defined no-proxy address list to default
set_fact: docker_no_proxy_combined: "{{ union(docker_no_proxy) | unique }}"
when: mode != 'restore'
What I don't understant is why "unique" doesn't remove duplicates, probably the syntax of IPv6 ip's is sligthly different?
This was introduced in: https:/ /review. opendev. org/#/c/ 693213/
Code that creates localhost_ override_ backup. yml will take the no_proxy list from the DB: SERVICE_ PARAM_NAME_ DOCKER_ NO_PROXY:
_value = docker. value.strip( "[]")
no_proxy_ list = _value.split(',')
data. update( {'docker_ no_proxy' : no_proxy_list})
for docker in docker_list:
# Get the docker no-proxy info if it exists
if docker.name == constants.
# Remove the open and close parenthesis if address is IPV6
and write it in localhost_ override_ backup. yml:
docker_no_proxy: 10a:a001: a103::1237] ' 10a:a001: a103::1235] ' 10a:a001: a103::1236] ' registry. cumulus. wrs.com
- localhost
- 127.0.0.1
- registry.local
- '[abcd:204::1]'
- '[abcd:204::2]'
- '[2620:
- '[2620:
- '[abcd:204::3]'
- '[2620:
- tis-lab-
Problem is that the original list of custom no_proxy registries used at configuration in localhost.yml is: registry. cumulus. wrs.com
docker_no_proxy:
- registry.local
- tis-lab-
Which ansible bootstrap writes to sysinv as: 127.0.0. 1,registry. local,[ abcd:204: :1],[abcd: 204::2] ,[2620: 10a:a001: a103::1237] ,[2620: 10a:a001: a103::1235] ,[abcd: 204::3] ,[2620: 10a:a001: a103::1236] ,tis-lab- registry. cumulus. wrs.com
localhost,
That's because ansible appends the two custom ones to a default list in:
docker_ no_proxy_ combined: "{{ default_no_proxy | union(docker_ no_proxy) | unique | ipwrap }}"
- name: Add user defined no-proxy address list to default
set_fact:
This means that at restore the list of defaults entries will be doubled, which leads to a string that is too long (hence the "The service parameter value is restricted to at most 255 characters." error).
Two possible solutions here: override_ backup. yml or no_proxy_ combined list whne mode == 'restore' with something like:
docker_ no_proxy_ combined: "{{ default_no_proxy | union(docker_ no_proxy) | unique | ipwrap }}"
A. Do not write the default values to localhost_
B. Do not append the default values to the docker_
- name: Add user defined no-proxy address list to default
set_fact:
when: mode != 'restore'
- name: Add user defined no-proxy address list to default
docker_ no_proxy_ combined: "{{ union(docker_ no_proxy) | unique }}"
set_fact:
when: mode != 'restore'
What I don't understant is why "unique" doesn't remove duplicates, probably the syntax of IPv6 ip's is sligthly different?