# Possible to switch credentials mid-playbook?

**URL:** <https://forum.ansible.com/t/possible-to-switch-credentials-mid-playbook/22606>\
**Category:** Ansible Project\
**Created:** [September 21, 2016, 7:07pm UTC](https://forum.ansible.com/t/possible-to-switch-credentials-mid-playbook/22606 "2016-09-21T19:07:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brantley\_West](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@Brantley\_West](https://forum.ansible.com/u/Brantley_West)\
**Post date:** [September 21, 2016, 7:07pm UTC](https://forum.ansible.com/t/possible-to-switch-credentials-mid-playbook/22606/1 "2016-09-21T19:07:50Z")

</div>

Hello,

Is there a way to instruct ansible to use a different username/password combinations for a tasks or plays within a playbook? I see the remote\_user variable, but do not see an accompanying remote\_pass variable. I need something like ansible\_ssh\_user and ansible\_ssh\_pass to be definable per-task or per-play. The problem I’m trying to solve is with a distro that has a default username/password that I want to replace with a different username/password, and then continue executing roles/plays with the new username/password. Thanks in advance!

-bw
