-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path06-kubectl.yml
39 lines (32 loc) · 900 Bytes
/
06-kubectl.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
---
- hosts: tag_krole_util
vars_files:
- vars/all.yml
tasks:
- include: common-kubernetes.yml
- include: common-kubectl.yml
- name: gather ec2_elb_facts
ec2_elb_facts:
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
region: "{{ aws_region }}"
names:
- "k8s-api-lb"
register: elb_facts
delegate_to: "localhost"
- set_fact:
k8s_api_lb: "{{ elb_facts['elbs'][0] }}"
- debug:
var: k8s_api_lb
- name: ensure user has a .kube directory
file:
path: "/home/ubuntu/.kube"
state: "directory"
owner: "ubuntu"
group: "ubuntu"
- name: install kubectl config file from template
template:
src: "templates/kubectl-config"
dest: "/home/ubuntu/.kube/config"
owner: "ubuntu"
group: "ubuntu"