--- - name: Wait for ssh gather_facts: false hosts: all tasks: - name: check 22/tcp ansible.builtin.wait_for: port: 22 connect_timeout: 30 - name: Configure nginx become: true hosts: all tasks: - name: install nginx ansible.builtin.apt: name: nginx state: present update_cache: true - name: copy config ansible.builtin.template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - name: restart service ansible.builtin.service: name: nginx state: restarted