-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhttps_proxy.yml
More file actions
65 lines (59 loc) · 1.83 KB
/
https_proxy.yml
File metadata and controls
65 lines (59 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
# Configure overcloud hosts to use an HTTP/HTTPS proxy server
# In this example the proxy server is hosted by seed-vm.
# A single HTTP proxy URL provides service for both HTTP and HTTPS.
# Note: with the values written to /etc/environment the config
# applied to bashrc could potentially be skipped.
- name: Configure bashrc HTTP proxy env variables
hosts: overcloud
tags:
- proxy
vars:
http_proxy: "http://{{ provision_oc_net_name | net_ip('seed-vm')}}:3128"
no_proxy: "localhost,127.0.0.1,{{ internal_net_vip_address }},{{ internal_net_name | net_ip }}"
tasks:
- name: Write http_proxy parameters to bashrc file
lineinfile:
path: "{{ ansible_user_dir }}/.bashrc"
create: yes
mode: 0755
state: present
regexp: "^export {{ item }}=.*"
line: "export {{ item }}={{ http_proxy }}"
with_items:
- http_proxy
- https_proxy
- name: Write http_proxy parameters to bashrc file for root user
lineinfile:
path: "/root/.bashrc"
create: yes
mode: 0755
state: present
regexp: "^export {{ item }}=.*"
line: "export {{ item }}={{ http_proxy }}"
with_items:
- http_proxy
- https_proxy
become: true
- name: Write http/s_proxy parameters to /etc/environment
lineinfile:
path: "/etc/environment"
create: yes
mode: 0755
state: present
regexp: "{{ item }}=.*"
line: "{{ item }}={{ http_proxy }}"
with_items:
- http_proxy
- https_proxy
become: true
- name: Write no_proxy parameters to /etc/environment
lineinfile:
path: "/etc/environment"
create: yes
mode: 0755
state: present
regexp: "no_proxy=.*"
line: "no_proxy={{ no_proxy }}"
become: true
...