-
Notifications
You must be signed in to change notification settings - Fork 1
/
clusters.yml
46 lines (42 loc) · 1.4 KB
/
clusters.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
- name: "Create minikube Clusters"
hosts: all
vars_files:
- vars.local.yml
roles:
- role: kameshsampath.minikube
tasks:
- name: "Configure metallb"
ansible.builtin.expect:
command: "{{ minikube_binary }} -p {{ item.key }} addons configure metallb"
responses:
"-- Enter Load Balancer Start IP:": "{{ item.value.lbStartIP}}"
"-- Enter Load Balancer End IP:": "{{ item.value.lbEndIP}}"
loop: "{{ minikube_profiles | dict2items }}"
loop_control:
label: "{{ item.key }}"
register: lb_setup_result
when: item.value.create and not item.value.destroy
- name: "Metallb result"
debug:
var: lb_setup_result
- name: "Ensure we are in mgmt context"
ansible.builtin.command:
argv:
- kubectl
- config
- use-context
- "mgmt"
environment:
KUBECONFIG: "{{ work_dir }}/.kube/config"
- name: "Ensure right permissions to kubeconfig directory"
ansible.builtin.file:
state: directory
recurse: yes
path: "{{ work_dir }}/.kube"
mode: "0700"
- name: "Setup .envrc"
ansible.builtin.blockinfile:
marker: "# {mark} fruits-api-gitops ANSIBLE MANAGED BLOCK"
path: "{{ work_dir }}/.envrc"
create: yes
block: "{{ lookup('template', playbook_dir + '/templates/' + '.envrc.j2') }}"