--- - name: run automation for windows gather_facts: no hosts: all become_method: runas tasks: - name: test connection for adagility block: - name: test connection wait_for_connection: timeout: 5 - name: debug aperamnet debug: var: useraperamnet rescue: - name: change credentials # set_fact: # ansible_user: "{{useraperamnet}}" # ansible_password: "{{passaperamnet}}" environment: ansible_user: "{{useraperamnet}}" ansible_password: "{{passaperamnet}}" - name: test connection for aperamnet wait_for_connection: timeout: 20