- hosts: Kubernetes_Master become: yes tasks: - name: Start the cluster shell: kubeadm init --pod-network-cidr=10.244.0.0/16 >> cluster.txt args: chdir: $HOME creates: cluster.txt - name: create .kube directory become: yes become_user: ubuntu file: path: $HOME/.kube state: directory mode: 0755 - name: copy admin.conf to user's kube config copy: src: /etc/kubernetes/admin.conf dest: /home/ubuntu/.kube/config remote_src: yes owner: ubuntu - name: install Pod network become: yes become_user: ubuntu shell: kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml >> pod_setup.txt args: chdir: $HOME creates: pod_setup.txt