-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcsi_fix.yml
34 lines (25 loc) · 926 Bytes
/
csi_fix.yml
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
---
- hosts: localhost
vars_files:
- config/config.yaml
tasks:
- name: get csp serivce ip
shell: kubectl get pods --selector app=hpe3parprimera-csp -n kube-system -o wide | awk '$3~/Running/' | awk '{print $7}'
register: csp_ip
- debug: msg="{{ nodes[csp_ip.stdout_lines[0]] }}"
- name: Copy CSP IP-name mapping to local file
local_action: copy content="{{ nodes[csp_ip.stdout_lines[0]] }} hpe3parprimera-csp-svc" dest="./csp-mapping"
- hosts: localhost,workers
tasks:
- name: Copy CSP name-ip mapping to local
copy: src=csp-mapping dest=/csp-ip-name-map
- name: Register
command: cat /csp-ip-name-map
register: csp_dns
- name: make entry in /etc/hosts
lineinfile:
path: /etc/hosts
line: "{{ csp_dns.stdout_lines[0] }}"
insertafter: EOF
- name: set no proxy for csp service name
shell: export no_proxy=$no_proxy,hpe3parprimera-csp-svc