diff options
author | Victor Morales <victor.morales@intel.com> | 2018-02-05 10:45:46 -0800 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2018-03-20 04:53:03 -0700 |
commit | 0d332a80cf731e5927c81c9f6929a8b83d43cddd (patch) | |
tree | 922231520ad28044cf99918027f0d5b063a12b29 /xci/installer/osa/playbooks | |
parent | e47cdad33ce29f7db4e0cb72c323ed63504afe16 (diff) |
Add proxy support
In some cases the XCI development environment can be located behind a
corporate proxy resulting in a additional layer to consider to
configure. These changes pretend to include proxy support for all
linux distros in all the posible flavors.
Change-Id: Iab469268809ac471d09e244bb3ccd83de1a41b88
Signed-off-by: Victor Morales <victor.morales@intel.com>
Diffstat (limited to 'xci/installer/osa/playbooks')
-rw-r--r-- | xci/installer/osa/playbooks/configure-opnfvhost.yml | 22 | ||||
-rw-r--r-- | xci/installer/osa/playbooks/configure-targethosts.yml | 12 |
2 files changed, 34 insertions, 0 deletions
diff --git a/xci/installer/osa/playbooks/configure-opnfvhost.yml b/xci/installer/osa/playbooks/configure-opnfvhost.yml index 4c30f4d1..647f175b 100644 --- a/xci/installer/osa/playbooks/configure-opnfvhost.yml +++ b/xci/installer/osa/playbooks/configure-opnfvhost.yml @@ -13,6 +13,13 @@ - "{{ XCI_PATH }}/xci/var/opnfv.yml" - "{{ XCI_PATH }}/xci/installer/osa/files/openstack_services.yml" + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" + no_proxy: "{{ lookup('env','no_proxy') }}" + HTTP_PROXY: "{{ lookup('env','http_proxy') }}" + HTTPS_PROXY: "{{ lookup('env','https_proxy') }}" + NO_PROXY: "{{ lookup('env','no_proxy') }}" pre_tasks: - name: Load distribution variables include_vars: @@ -29,6 +36,11 @@ roles: - role: bootstrap-host configure_network: XCI_FLAVOR != 'aio' + - role: peru.proxy_settings + proxy_settings_http_proxy: "{{ lookup('env','http_proxy') }}" + proxy_settings_https_proxy: "{{ lookup('env','https_proxy') }}" + proxy_settings_ftp_proxy: "{{ lookup('env','ftp_proxy') }}" + proxy_settings_no_proxy: "{{ lookup('env','no_proxy') }}" tasks: - name: generate SSH keys @@ -75,6 +87,16 @@ - name: copy user_variables_ceph.yml shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_variables_ceph.yml {{OPENSTACK_OSA_ETC_PATH}}/user_variables_ceph.yml" when: XCI_CEPH_ENABLED == "true" + - block: + - name: copy user_variables_proxy.yml + shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/user_variables_proxy.yml {{OPENSTACK_OSA_ETC_PATH}}/user_variables_proxy.yml" + - name: "Configure http_proxy_env_url" + lineinfile: + path: "{{OPENSTACK_OSA_ETC_PATH}}/user_variables_proxy.yml" + regexp: "^http_proxy_env_url:.*" + line: "{{ 'http_proxy_env_url: ' + lookup('env','http_proxy') }}" + when: + - lookup('env','http_proxy') != "randomfoobarstring" - name: copy OPNFV OpenStack playbook shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks" - name: copy pinned versions of OSA Roles and global requirements diff --git a/xci/installer/osa/playbooks/configure-targethosts.yml b/xci/installer/osa/playbooks/configure-targethosts.yml index 31c3e02e..42822c96 100644 --- a/xci/installer/osa/playbooks/configure-targethosts.yml +++ b/xci/installer/osa/playbooks/configure-targethosts.yml @@ -1,5 +1,12 @@ --- - hosts: openstack + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" + no_proxy: "{{ lookup('env','no_proxy') }}" + HTTP_PROXY: "{{ lookup('env','http_proxy') }}" + HTTPS_PROXY: "{{ lookup('env','https_proxy') }}" + NO_PROXY: "{{ lookup('env','no_proxy') }}" remote_user: root vars_files: - "{{ XCI_PATH }}/xci/var/opnfv.yml" @@ -12,6 +19,11 @@ - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml" - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml" roles: + - role: peru.proxy_settings + proxy_settings_http_proxy: "{{ lookup('env','http_proxy') }}" + proxy_settings_https_proxy: "{{ lookup('env','https_proxy') }}" + proxy_settings_ftp_proxy: "{{ lookup('env','ftp_proxy') }}" + proxy_settings_no_proxy: "{{ lookup('env','no_proxy') }}" - role: bootstrap-host - role: configure-nfs when: |