several ways: You could have the first task attempt to 'connect as root and set the other user', ignore their failure and continue with rest of play with correct credentials
You could skip the 'as root' tasks depending on a passed var Variation on the above, have the play update host_vars for that host with needs_root=False and have needs_root=True in group_vars/all.yml after updating the machine to not need root. Another variation, add the host to 'doesnt_need_root' group in play etc. ---------- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7fML8q%3DppfN9w%2BkjLAAejH26m7SXzsooBrRN5gAwcLxFg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
