Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct value of remote_user for local connections #12783

Merged
merged 1 commit into from
Oct 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/ansible/plugins/connection/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import subprocess
import select
import fcntl
import getpass

import ansible.constants as C

Expand All @@ -41,6 +42,11 @@ def transport(self):
def _connect(self, port=None):
''' connect to the local host; nothing to do here '''

# Because we haven't made any remote connection we're running as
# the local user, rather than as whatever is configured in
# remote_user.
self._play_context.remote_user = getpass.getuser()

if not self._connected:
self._display.vvv("ESTABLISH LOCAL CONNECTION FOR USER: {0}".format(self._play_context.remote_user, host=self._play_context.remote_addr))
self._connected = True
Expand Down