- hosts: do remote_user: root gather_facts: false vars: ansible_python_interpreter: /usr/bin/python3 tasks: - name: wait for port 22 to become available wait_for: host: "{{ inventory_hostname }}" port: 22 delegate_to: localhost - name: Gather Facts setup: - name: install nginx apt: name: nginx - name: modify html file template: src: ./index.html.j2 dest: /var/www/html/index.html