--- - name: Create the RBAC cluster role for kubelet authorization hosts: debian-k8s-master1.ipa.champion become: true tasks: - name: Copy the clusterrole and clusterrolebinding RBAC yaml files copy: src: files/{{ item }} dest: /home/ansible/{{ item }} with_items: - clusterrole-api-to-kubelet.yaml - clusterrolebinding-api-to-kubelet.yaml - name: Apply the RBAC role to the cluster command: kubectl apply -f {{ item }} --kubeconfig /home/ansible/admin.kubeconfig with_items: - clusterrole-api-to-kubelet.yaml - clusterrolebinding-api-to-kubelet.yaml