--- - name: Playbook to automate a manual k8s installation hosts: masters become: true tasks: - name: Enable API server health checks apt: name: nginx state: present - name: Configure NGINX correctly template: src: templates/kubernetes.default.svc.cluster.local.j2 dest: /etc/nginx/sites-available/kubernetes.default.svc.cluster.local - name: Activate the configuration file: src: /etc/nginx/sites-available/kubernetes.default.svc.cluster.local path: /etc/nginx/sites-enabled/kubernetes.default.svc.cluster.local state: link - name: Start the NGINX service service: name: nginx state: started enabled: true