openstack-ansible-ops/multi-node-aio-xenial-ansible/roles/proxy_install/tasks/configure.yml

38 lines
1.3 KiB
YAML

---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: proxy_install/tasks/configure
# description: Configure proxy_install
- name: Setup http proxy for APT
template:
src: 80proxy.j2
dest: "{{ apt_proxy_path }}"
mode: 0644
owner: root
group: root
- name: Setup http proxy environment variables
lineinfile:
dest: "{{ environment_path }}"
line: "{{ item.line }}"
regexp: "{{ item.regexp }}"
with_items:
- { line: "http_proxy={{ proxy }}", regexp: "^http_proxy=" }
- { line: "https_proxy={{ proxy }}", regexp: "^https_proxy=" }
- { line: "RSYNC_PROXY={{ proxy }}", regexp: "^RSYNC_PROXY=" }
- name: Change current environment variables, change disabled since it runs each time
shell: "export http_proxy={{ proxy }}; export https_proxy={{ proxy }}; export RSYNC_PROXY={{ proxy }}"
changed_when: false