From 5e4b8d04d7b078d4d1861a8701b8dc85c9edc3d6 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 14 Jun 2017 17:36:46 -0400 Subject: [PATCH] readded missing become configs --- lib/ansible/constants.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index a9b810712a..fb33b6f032 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -39,6 +39,26 @@ def mk_boolean(value): BLACKLIST_EXTS = ('.pyc', '.pyo', '.swp', '.bak', '~', '.rpm', '.md', '.txt') BECOME_METHODS = ['sudo', 'su', 'pbrun', 'pfexec', 'doas', 'dzdo', 'ksu', 'runas', 'pmrun'] +BECOME_ERROR_STRINGS = { + 'sudo': 'Sorry, try again.', + 'su': 'Authentication failure', + 'pbrun': '', + 'pfexec': '', + 'doas': 'Permission denied', + 'dzdo': '', + 'ksu': 'Password incorrect', + 'pmrun': 'You are not permitted to run this command' +} # FIXME: deal with i18n +BECOME_MISSING_STRINGS = { + 'sudo': 'sorry, a password is required to run sudo', + 'su': '', + 'pbrun': '', + 'pfexec': '', + 'doas': 'Authorization required', + 'dzdo': '', + 'ksu': 'No password given', + 'pmrun': '' +} # FIXME: deal with i18n BOOL_TRUE = config.data.BOOL_TRUE DEFAULT_BECOME_PASS = None DEFAULT_PASSWORD_CHARS = to_text(ascii_letters + digits + ".,:-_", errors='strict') # characters included in auto-generated passwords