Update container_proxy with configurable proxy settings

For a deployment behind a firewall/proxy server some additional
environment settings should be passed along, for containers
such as magnum

This commit adds three new properties;
 container_http_proxy
 container_https_proxy
 container_no_proxy

In particular, the user will want to set container_http_proxy
and container_https_proxy properties with the proxy server
details.

Closes-Bug: #1628335
Change-Id: I0950a0467b4b68c38b13875eaf9cd433e64363cf
This commit is contained in:
James McCarthy 2017-10-05 09:28:13 +01:00
parent 709c6b7ba5
commit 9369ad127c
5 changed files with 35 additions and 0 deletions

View File

@ -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
####################

View File

@ -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"

View File

@ -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]

View File

@ -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"

View File

@ -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.