-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_dependencies_micro_box.yml
More file actions
99 lines (84 loc) · 2.27 KB
/
install_dependencies_micro_box.yml
File metadata and controls
99 lines (84 loc) · 2.27 KB
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
- hosts: smartx-micro-box-gist-1
become: yes
tasks:
- name: Install APT Transport HTTPS
apt:
name: apt-transport-https
state: present
- name: Add Kubernetes apt-key
apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
state: present
- name: Add Kubernetes' APT repository
apt_repository:
repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
state: present
filename: 'kubernetes'
- name: Add an apt signing key for Docker
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Get the latest stable version
shell: lsb_release -cs
register: stable_version
- name: Add apt repository for stable version
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ stable_version.stdout_lines[0] }} stable
state: present
- name: Install docker and its dependecies
apt:
name: "{{ packages }}"
state: present
update_cache: yes
vars:
packages:
- docker-ce
- docker-ce-cli
- containerd.io
notify:
- docker status
- name: Add "{{ ansible_user }}" current user to docker group
user:
name: "{{ ansible_user}}"
group: docker
- name: Remove swapfile from /etc/fstab
mount:
name: "{{ item }}"
fstype: swap
state: absent
src: none
with_items:
- swap
- none
- name: Disable swap
command: swapoff -a
when: ansible_swaptotal_mb > 0
- name: Install Kubernetes binaries
apt:
name: "{{ packages }}"
state: present
update_cache: yes
vars:
packages:
- kubelet
- kubeadm
- name: Install bridge-utils
apt:
name: bridge-utils
state: present
update_cache: true
- name: Install hostapd
apt:
name: hostapd
state: present
update_cache: true
- name: Install dnsmasq
apt:
name: dnsmasq
state: present
update_cache: true
- name: Hold tools
command: apt-mark hold kubelet kubeadm docker-ce docker-ce-cli containerd.io
handlers:
- name: docker status
service: name=docker state=started