-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes.yml
44 lines (39 loc) · 906 Bytes
/
kubernetes.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
---
# file: kubernetes.yml
- hosts: kubernetes
become: true
roles:
- os
- geerlingguy.ntp
- docker
- access
- hosts: kubernetes
become: true
tasks:
- name: Fetch public keys
fetch:
flat: true
src: /home/{{ cluster_user }}/.ssh/id_rsa.pub
dest: /tmp/id_rsa_{{ inventory_hostname }}.pub
- hosts: kubernetes
become: true
tasks:
- name: Add public keys to authorized_keys
authorized_key:
user: '{{ cluster_user }}'
key: '{{ lookup("file", "/tmp/id_rsa_" + item + ".pub") }}'
with_items: '{{ ansible_play_batch }}'
- hosts: kubernetes_admin
become: true
roles:
- rke
- hosts: kubernetes_admin
become: true
become_user: '{{ cluster_user }}'
roles:
- role: longhorn
when: install_longhorn | bool
- role: helm
when: install_helm | bool
- role: cert-manager
when: install_cert_manager | bool