Added seed code for caas-kubernetes.
[ta/caas-kubernetes.git] / ansible / roles / kubelet / tasks / main.yml
1 ---
2 # Copyright 2019 Nokia
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 - import_tasks: preconfig.yml
17
18 - name: create libs
19   file:
20     name: "{{ item }}"
21     state: directory
22   with_items:
23     - /var/lib/kubelet
24     - /var/lib/cni
25     - /etc/kubernetes/manifests
26     - /etc/kubernetes/kubeconfig
27
28 - name: template env.list
29   template:
30     src: env.list
31     dest: /etc/kubernetes/env.list
32
33 - import_tasks: configure_kubelet.yml
34
35 - name: daemon reload
36   command: /usr/bin/systemctl daemon-reload
37
38 - name: restart kubelet
39   service:
40     name: kubelet.service
41     state: started
42     enabled: true
43
44 - name: restart kubelet_healthcheck
45   service:
46     name: kubelet_healthcheck.service
47     state: started
48     enabled: true
49   become_user: "root"