[...] - name: ChangePW hosts: fg vars: ansible_user: admin ansible_ssh_common_args: -o StrictHostKeyChecking=no ansible_ssh_pass: "{{ hostvars['localhost'].stackinfo.stack_outputs.FortiGateId }}" gather_facts: no tasks: - raw: | "{{ hostvars['localhost'].fgtpw }}" "{{ hostvars['localhost'].fgtpw }}" config system interface edit port2 set mode static set ip "{{ hostvars['localhost'].stackinfo.stack_outputs.FGIntAddress }}/17" next end tags: pw - name: Wait for License Reboot pause: minutes: 1 - name: Wait for VM to be up wait_for: host: "{{ inventory_hostname }}" port: 22 state: started delegate_to: localhost [...]