diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 508553abaa..4c7a2a7abc 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -49,6 +49,16 @@ kolla_dev_repos_git: "https://git.openstack.org/openstack" kolla_dev_repos_pull: "no" kolla_dev_mode: "no" +# Proxy settings for containers such as magnum that need internet access +container_http_proxy: "" +container_https_proxy: "" +container_no_proxy: "localhost,127.0.0.1" + +container_proxy: + http_proxy: "{{ container_http_proxy }}" + https_proxy: "{{ container_https_proxy }}" + no_proxy: "{{ container_no_proxy }},{{ api_interface_address }},{{ kolla_internal_vip_address }}" + #################### # kolla-kubernetes #################### diff --git a/ansible/roles/magnum/defaults/main.yml b/ansible/roles/magnum/defaults/main.yml index 9e7c2ac612..0b717aa884 100644 --- a/ansible/roles/magnum/defaults/main.yml +++ b/ansible/roles/magnum/defaults/main.yml @@ -7,6 +7,8 @@ magnum_services: group: magnum-api enabled: true image: "{{ magnum_api_image_full }}" + environment: + DUMMY_ENVIRONMENT: kolla_useless_env volumes: - "{{ node_config_directory }}/magnum-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" @@ -16,6 +18,7 @@ magnum_services: group: magnum-conductor enabled: true image: "{{ magnum_conductor_image_full }}" + environment: "{{ container_proxy }}" volumes: - "{{ node_config_directory }}/magnum-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" diff --git a/ansible/roles/magnum/handlers/main.yml b/ansible/roles/magnum/handlers/main.yml index 2b15347164..79430d023c 100644 --- a/ansible/roles/magnum/handlers/main.yml +++ b/ansible/roles/magnum/handlers/main.yml @@ -13,6 +13,7 @@ name: "{{ service.container_name }}" image: "{{ service.image }}" volumes: "{{ service.volumes }}" + environment: "{{ service.environment }}" when: - action != "config" - inventory_hostname in groups[service.group] @@ -36,6 +37,7 @@ name: "{{ service.container_name }}" image: "{{ service.image }}" volumes: "{{ service.volumes }}" + environment: "{{ service.environment }}" when: - action != "config" - inventory_hostname in groups[service.group] diff --git a/ansible/roles/magnum/tasks/config.yml b/ansible/roles/magnum/tasks/config.yml index e4718ac54c..5571eb5094 100644 --- a/ansible/roles/magnum/tasks/config.yml +++ b/ansible/roles/magnum/tasks/config.yml @@ -68,6 +68,7 @@ name: "{{ item.value.container_name }}" image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" + environment: "{{ item.value.environment }}" register: check_magnum_containers when: - action != "config" diff --git a/releasenotes/notes/container-proxy-settings-for-magnum-0300dad7ee461865.yaml b/releasenotes/notes/container-proxy-settings-for-magnum-0300dad7ee461865.yaml new file mode 100644 index 0000000000..2ca8d09d2f --- /dev/null +++ b/releasenotes/notes/container-proxy-settings-for-magnum-0300dad7ee461865.yaml @@ -0,0 +1,19 @@ +--- +features: | + Update container_proxy with configurable proxy settings + Added three new properties: + + - container_http_proxy + + This defaults to an empty string. To set a proxy adjust this + property to something like "http://proxy-server.organization.com:port" + + - container_https_proxy + + This defaults to an empty string. To set a proxy adjust this + property to something like "https://proxy-server.organization.com:port" + + - container_no_proxy + + This defaults to some preconfigured settings which should suit. + If needed this can also be adjusted.