2 # Copyright (c) 2018 Intel Corporation.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 env_http_proxy=$(sed -ne "s/^http_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment)
17 if [[ -z ${http_proxy} ]] && [[ ! -z ${env_http_proxy} ]]; then
18 export http_proxy=${env_http_proxy}
20 env_https_proxy=$(sed -ne "s/^https_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment)
21 if [[ -z ${https_proxy} ]] && [[ ! -z ${env_https_proxy} ]]; then
22 export https_proxy=${env_https_proxy}
24 env_ftp_proxy=$(sed -ne "s/^ftp_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment)
25 if [[ -z ${ftp_proxy} ]] && [[ ! -z ${env_ftp_proxy} ]]; then
26 export ftp_proxy=${env_ftp_proxy}
28 if [[ ! -z ${http_proxy} ]] || [[ ! -z ${https_proxy} ]]; then
29 export no_proxy="${no_proxy}"
30 extra_args="${extra_args} -e @/tmp/proxy.yml "
31 cat <<EOF > /tmp/proxy.yml
34 http_proxy: ${http_proxy}
35 https_proxy: ${https_proxy}
36 ftp_proxy: ${ftp_proxy}
40 ANSIBLE_SCRIPTS="${0%/*}/../ansible"
42 cd ${ANSIBLE_SCRIPTS} && \
43 sudo -EH ansible-playbook \
44 -e RS_FILE='../etc/infra/infra_deploy_two.yaml' -e CLEAN_UP=False ${extra_args} \
45 -i inventory.ini infra_deploy.yml