aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml
blob: 8604185aa228a125c715a8814231607345fe2759 (plain)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
---
# file: roles/tg_sut/tasks/ubuntu.yaml

- name: Install python-dev
  apt:
    name: 'python-dev'
    state: 'present'
    update_cache: True
  tags: install-python-dev

- name: Install python-virtualenv
  apt:
    name: 'python-virtualenv'
    state: 'present'
    update_cache: True
  tags: install-python-virtualenv

- name: Install python pip
  apt:
    name: 'python-pip'
    state: 'present'
    update_cache: True
  tags: install-python-pip

- name: Install libpcap-dev
  apt:
    name: 'libpcap-dev'
    state: 'present'
    update_cache: True
  tags: install-libpcap-dev

- name: Install cpufrequtils
  apt:
    name: 'cpufrequtils'
    state: 'present'
    update_cache: True
  tags: install-cpufrequtils

- name: Install cgroup-support
  apt:
    name: 'cgroup-bin'
    state: 'present'
    update_cache: True
  tags: install-cgroup-support

- name: Install zlib1g-dev
  apt:
    name: 'zlib1g-dev'
    state: 'present'
    update_cache: True
  tags: install-zlib1g-dev

- name: Install libnuma-dev
  apt:
    name: 'libnuma-dev'
    state: 'present'
    update_cache: True
  tags: install-libnuma-dev

- name: Install Docker and role dependencies
  apt:
    name: "{{ item }}"
    state: "present"
    install_recommends: False
  with_items:
    - "apt-transport-https"
    - "ca-certificates"
    - "software-properties-common"
    - "cron"
  tags: install-docker

- name: Install Docker APT GPG key
  apt_key:
    url: https://download.docker.com/linux/ubuntu/gpg
    state: "present"
  tags: install-docker

- name: Install Docker APT repository
  apt_repository:
    repo: "{{ docker_repository }}"
    state: "present"
    update_cache: True
  tags: install-docker

- name: Install Docker
  apt:
    name: "docker-{{ docker_edition }}={{ docker_apt_package_name }}"
    state: "present"
    update_cache: True
    install_recommends: False
    cache_valid_time: "{{ apt_cache_time }}"
  tags: install-docker

- name: Remove Upstart docker config file
  file:
    path: "/etc/default/docker"
    state: "absent"
  tags: docker

- name: Ensure systemd directory exists
  file:
    path: "/etc/systemd/system"
    state: "directory"
    owner: "root"
    group: "root"
    mode: "0755"
  tags: ensure-docker

- name: Copy systemd docker unit file
  template:
    src: "templates/docker.service.j2"
    dest: "/etc/systemd/system/docker.service"
    owner: "root"
    group: "root"
    mode: "0644"
  register: docker_register_systemd_service
  tags: copy-docker

- name: Reload systemd daemon
  command: "systemctl daemon-reload"
  notify: ["Restart Docker"]
  when: (docker_register_systemd_service and
         docker_register_systemd_service is changed)
  tags: restart-docker

- name: Set specific users to "docker" group
  user:
    name: "{{ item }}"
    groups: "docker"
    append: True
  with_items: "{{ docker_users }}"
  when: docker_users
  tags: set-docker

- name: Install kubernetes APT GPG key
  apt_key:
    url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
    state: "present"
  tags: install-kubernetes

- name: Install kubernetes APT repository
  apt_repository:
    repo: "{{ kubernetes_repository }}"
    state: "present"
    update_cache: True
  tags: install-kubernetes

- name: Install kubeadm
  apt:
    name: "kubeadm={{ kubernetes_apt_package_name }}"
    state: "present"
    force: yes
    update_cache: True
    install_recommends: False
    cache_valid_time: "{{ apt_cache_time }}"
  tags: install-kubernetes

- name: Install kubectl
  apt:
    name: "kubectl={{ kubernetes_apt_package_name }}"
    state: "present"
    force: yes
    update_cache: True
    install_recommends: False
    cache_valid_time: "{{ apt_cache_time }}"
  tags: install-kubernetes

- name: Install kubelet
  apt:
    name: "kubelet={{ kubernetes_apt_package_name }}"
    state: "present"
    force: yes
    update_cache: True
    install_recommends: False
    cache_valid_time: "{{ apt_cache_time }}"
  tags: install-kubernetes

- name: Apply kubelet parameter
  lineinfile:
    path: '/etc/default/kubelet'
    state: 'present'
    regexp: '^KUBELET_EXTRA_ARGS=*'
    line: 'KUBELET_EXTRA_ARGS=--feature-gates HugePages=false'
  tags: install-kubernetes