From db8c952ee3eca361f2ccb9c92da789e86aee2283 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 13 Sep 2016 14:32:44 -0400 Subject: [PATCH] added new ksu method to man page removed runas refrences, because it was never implemented --- docs/man/man1/ansible.1.asciidoc.in | 2 +- lib/ansible/constants.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/man/man1/ansible.1.asciidoc.in b/docs/man/man1/ansible.1.asciidoc.in index ca3ad8f404..d525eca33b 100644 --- a/docs/man/man1/ansible.1.asciidoc.in +++ b/docs/man/man1/ansible.1.asciidoc.in @@ -69,7 +69,7 @@ Run commands in the background, killing the task after 'NUM' seconds. *--become-method=*'BECOME_METHOD':: Privilege escalation method to use (default=sudo), -valid choices: [ sudo | su | pbrun | pfexec | runas | doas | dzdo ] +valid choices: [ sudo | su | pbrun | pfexec | doas | dzdo | ksu ] *--become-user=*'BECOME_USER':: diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 589e006d38..0cc4c343dc 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -216,9 +216,9 @@ DEFAULT_SUDO_FLAGS = get_config(p, DEFAULTS, 'sudo_flags', 'ANSIBLE_SUDO_ DEFAULT_ASK_SUDO_PASS = get_config(p, DEFAULTS, 'ask_sudo_pass', 'ANSIBLE_ASK_SUDO_PASS', False, boolean=True) # Become -BECOME_ERROR_STRINGS = {'sudo': 'Sorry, try again.', 'su': 'Authentication failure', 'pbrun': '', 'pfexec': '', 'runas': '', 'doas': 'Permission denied', 'dzdo': '', 'ksu': 'Password incorrect'} #FIXME: deal with i18n -BECOME_MISSING_STRINGS = {'sudo': 'sorry, a password is required to run sudo', 'su': '', 'pbrun': '', 'pfexec': '', 'runas': '', 'doas': 'Authorization required', 'dzdo': '', 'ksu': 'No password given'} #FIXME: deal with i18n -BECOME_METHODS = ['sudo','su','pbrun','pfexec','runas','doas','dzdo','ksu'] +BECOME_ERROR_STRINGS = {'sudo': 'Sorry, try again.', 'su': 'Authentication failure', 'pbrun': '', 'pfexec': '', 'doas': 'Permission denied', 'dzdo': '', 'ksu': 'Password incorrect'} #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'} #FIXME: deal with i18n +BECOME_METHODS = ['sudo','su','pbrun','pfexec','doas','dzdo','ksu'] BECOME_ALLOW_SAME_USER = get_config(p, 'privilege_escalation', 'become_allow_same_user', 'ANSIBLE_BECOME_ALLOW_SAME_USER', False, boolean=True) DEFAULT_BECOME_METHOD = get_config(p, 'privilege_escalation', 'become_method', 'ANSIBLE_BECOME_METHOD','sudo' if DEFAULT_SUDO else 'su' if DEFAULT_SU else 'sudo' ).lower() DEFAULT_BECOME = get_config(p, 'privilege_escalation', 'become', 'ANSIBLE_BECOME',False, boolean=True)