-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnodes-play.yml
146 lines (134 loc) · 3.27 KB
/
nodes-play.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
- hosts: all
tasks:
- name: get kubernetes apt key
ansible.builtin.apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
state: present
- name: add kubernetes repository
ansible.builtin.apt_repository:
repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
state: present
#register: apt_status
##until: apt_status|success
#until: apt_status is success
#delay: 10
#retries: 10
- name: get docker apt key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
- name: get docker apt key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: add docker-ce repository
ansible.builtin.apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable
state: present
register: apt_status
#until: apt_status|success
#until: apt_status is success
#delay: 10
#retries: 10
- name: Create /etc/containerd
file:
path: /etc/containerd
state: directory
owner: root
- name: Copy containerd conf file
copy:
src: "files/config.toml"
dest: "/etc/containerd/config.toml"
owner: root
group: root
mode: 0644
- name: Copy crictl config file
copy:
src: "files/crictl.yaml"
dest: "/etc/crictl.yaml"
owner: root
group: root
mode: 0644
- name: install packages
ansible.builtin.apt:
name:
- docker-ce
- kubelet
- kubeadm
- kubectl
- socat
- conntrack
- ipset
- jq
- ipvsadm
- mc
- tmux
- git
- vim
- fzf
- binutils
- make
- gcc
- mcedit
update_cache: yes
force: yes
#register: apt_status
#until: apt_status is success
#delay: 10
#retries: 10
- name: disable ufw
systemd:
name: ufw
enabled: no
masked: yes
state: stopped
- name: disable ufw via shell
shell: ufw disable
- name: Load Kernel Modules for K8S - ip_vs
modprobe:
name: "ip_vs"
state: "present"
- name: set EDITOR=vim :)
lineinfile:
dest: /etc/environment
regexp: "^EDITOR"
line: "EDITOR=vim"
state: present
- name: create user
user:
name: "{{ user }}"
groups: "sudo, docker"
#group: "admin"
shell: /bin/bash
- name: Load Kernel Modules for K8S - ip_vs_rr
modprobe:
name: "ip_vs_rr"
state: "present"
- name: Load Kernel Modules for K8S - ip_vs_wrr
modprobe:
name: "ip_vs_wrr"
state: "present"
- name: Load Kernel Modules for K8S - ip_vs_sh
modprobe:
name: "ip_vs_sh"
state: "present"
- name: Copy k8s Modules Files for Modules Load
copy:
src: "files/k8s-modules.conf"
dest: "/etc/modules-load.d/k8s-modules.conf"
owner: root
group: root
mode: 0644
- name: set pid_max to 4194303 (sysctl)
sysctl:
name: kernel.pid_max
value: 4194303
reload: yes
- name: Add mcedit alias
lineinfile:
path=/home/k8s/.bash_aliases
line="alias mcedit='mcedit -x'"
owner=k8s
regexp='^alias mcedit'
state=present
insertafter=EOF
create=True