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

dzdo: fix password prompt #59208

Merged
merged 1 commit into from Jul 18, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions changelogs/fragments/dzdo_password_prompt.yml
@@ -0,0 +1,2 @@
bugfixes:
- dzdo did not work with password authentication
6 changes: 3 additions & 3 deletions lib/ansible/plugins/become/dzdo.py
Expand Up @@ -25,7 +25,7 @@
- name: ANSIBLE_BECOME_USER
- name: ANSIBLE_DZDO_USER
become_exe:
description: Sudo executable
description: Dzdo executable
default: dzdo
ini:
- section: privilege_escalation
Expand Down Expand Up @@ -87,8 +87,8 @@ def build_become_command(self, cmd, shell):

flags = self.get_option('become_flags') or ''
if self.get_option('become_pass'):
self._prompt = '[dzdo via ansible, key=%s] password:' % self._id
flags = '%s -p "%s"' % (flags.replace('-n', ''), self._prompt)
self.prompt = '[dzdo via ansible, key=%s] password:' % self._id
flags = '%s -p "%s"' % (flags.replace('-n', ''), self.prompt)

user = self.get_option('become_user') or ''
if user:
Expand Down