-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlocalIngress.yml
61 lines (56 loc) · 1.44 KB
/
localIngress.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
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
---
- name: Check host entries for webpages
lineinfile:
path: /etc/hosts
line: 127.0.0.1 {{ hostsDNS }}
state: present
check_mode: yes
register: hostsChecks
with_items:
- "{{ ingressRoutes }}"
loop_control:
loop_var: hostsDNS
- name: Ask user for password to add hosts
pause:
prompt: "Enter SUDO password"
echo: no
register: sudo
when: hostsChecks.changed == true and ansible_become_pass is undefined
no_log: yes
- name: Set ansible become password
set_fact:
ansible_become_pass: "{{ sudo.user_input }}"
no_log: yes
when: hostsChecks.changed == true
- name: Add host entries for webpages
lineinfile:
path: /etc/hosts
line: 127.0.0.1 {{ item }}
state: present
with_items:
- "{{ ingressRoutes }}"
when: hostsChecks.changed == true
become: yes
- name: enable ingress and load tool ingresses
block:
- name: Find all manifests in manifests/ingress directory
find:
paths: "{{ playbook_dir }}/files/manifests/ingress/"
file_type: file
use_regex: yes
patterns:
- '.*.yml$'
- '.*.yaml$'
register: ingressManifests
- name: Load Cluster tools ingress manifests
k8s:
state: present
src: "{{ ingressLoad }}"
wait: yes
wait_condition:
reason: completed
status: "True"
wait_timeout: 360
loop: "{{ ingressManifests.files | map(attribute='path') | list }}"
loop_control:
loop_var: ingressLoad