From a6fc6c92f57e7e34a081c7a75e0fdf3dc204f58c Mon Sep 17 00:00:00 2001 From: Lokesh S Date: Mon, 6 Jul 2015 12:37:24 +0000 Subject: [PATCH] setting proxies at roles level using lookup plugin Change-Id: I4f858af5cf65399e7236c0b7bd6c9d2cb5f1d9da --- README.rst | 5 +++++ playbooks/install.yaml | 3 +++ playbooks/test-bifrost-dynamic.yaml | 6 ++++++ playbooks/test-bifrost.yaml | 3 +++ 4 files changed, 17 insertions(+) diff --git a/README.rst b/README.rst index d4018bcca..527646ffd 100644 --- a/README.rst +++ b/README.rst @@ -85,6 +85,11 @@ Edit ``./playbooks/inventory/group_vars/all`` to match your environment. - Change network_interface to match the interface that will need to service DHCP requests. - Change the ironic_db_password which is set by Ansible in MySQL and in Ironic's configuration file. +Proxy:: + +if running behind the proxy. export environment variables http_proxy and https_proxy +So that ansible lookup plugin checks for proxy set and uses as environment variables. + Then run:: bash ./scripts/env-setup.sh diff --git a/playbooks/install.yaml b/playbooks/install.yaml index 12e5df785..adc17afb1 100644 --- a/playbooks/install.yaml +++ b/playbooks/install.yaml @@ -7,3 +7,6 @@ roles: - { role: bifrost-prep-for-install, when: skip_install is not defined } - ironic-install + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" diff --git a/playbooks/test-bifrost-dynamic.yaml b/playbooks/test-bifrost-dynamic.yaml index 5a1568d29..0e3d0d4de 100644 --- a/playbooks/test-bifrost-dynamic.yaml +++ b/playbooks/test-bifrost-dynamic.yaml @@ -30,6 +30,9 @@ roles: - { role: bifrost-prep-for-install, when: skip_install is not defined } - { role: bifrost-openstack-ci-prep, when: ci_testing_zuul is defined } + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" - hosts: localhost connection: local name: "Executes install, enrollment, and testing in one playbook" @@ -47,6 +50,9 @@ - role: ironic-install cleaning: false testing: true + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" - hosts: baremetal name: "Enroll node with Ironic" sudo: no diff --git a/playbooks/test-bifrost.yaml b/playbooks/test-bifrost.yaml index de02af614..288b0f6b4 100644 --- a/playbooks/test-bifrost.yaml +++ b/playbooks/test-bifrost.yaml @@ -37,6 +37,9 @@ - role: ironic-enroll testing: true - role: bifrost-validate-host-for-deploy + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" - hosts: localhost connection: local name: "Executes install, enrollment, and testing in one playbook"