1 # Copyright (c) 2018-2019 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
19 - name: Reset Kubernetes cluster
20 command: kubeadm reset
22 - name: Clean Kubernetes directories (w/o removing the folder itself)
23 shell: rm -fr {{ item }}/*
29 - name: Create Multus CNI plugin dir
30 file: path=/etc/cni/net.d state=directory
32 - name: Configure Multus CNI plugin
33 template: src=10-multus-cni.conf.j2 dest=/etc/cni/net.d/10-multus-cni.conf owner=root mode=0644
35 - name: Change default kubelet cluster dns IP
37 path: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
38 regexp: '^(.*)--cluster-dns=([0-9\.]*)( +.*)$'
39 line: '\1--cluster-dns={{ kubelet_cluster_dns_ip }}\3'
43 - name: Systemd daemon reload
44 command: systemctl daemon-reload
46 - name: Restart kubelet
47 service: name=kubelet state=restarted
49 - name: Initialize kubeadm
52 - name: Create CMK Kubernetes resources
53 command: kubectl create -f {{ item }}
55 - "{{ cmk_rbc_rules_url }}"
56 - "{{ cmk_serviceaccount }}"
58 - name: Create Kubernetes resources
67 - name: Create a ClusterRoleBinding for a particular ClusterRole
69 kubectl create clusterrolebinding multus-node-{{ ansible_hostname }}
70 --clusterrole=multus-crd-overpowered --user=system:node:{{ ansible_hostname }}