From 829f48e3f5fe57783daf575906522dcc1836e66a Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 14 Sep 2018 11:16:13 -0500 Subject: [PATCH] Flip default for AGNOSTIC_BECOME_PROMPT (#45563) * Flip default for AGNOSTIC_BECOME_PROMPT * simplify AGNOSTIC_BECOME_PROMPT porting guide entry * clarify AGNOSTIC_BECOME_PROMPT changelog entry * fixes version typo * uses alternate wording (rather than escaping *) --- .../fragments/agnostic-become-prompt.yaml | 2 ++ .../rst/porting_guides/porting_guide_2.8.rst | 20 +++++++++++++++++++ lib/ansible/config/base.yml | 3 +-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/agnostic-become-prompt.yaml diff --git a/changelogs/fragments/agnostic-become-prompt.yaml b/changelogs/fragments/agnostic-become-prompt.yaml new file mode 100644 index 0000000000..dd30fde7e4 --- /dev/null +++ b/changelogs/fragments/agnostic-become-prompt.yaml @@ -0,0 +1,2 @@ +minor_changes: +- become - Change the default value for `AGNOSTIC_BECOME_PROMPT` to `True` so become prompts display `BECOME password:` regardless of the become method used. To display the become method in the prompt (for example, `SUDO password:`), set this config option to `False`. diff --git a/docs/docsite/rst/porting_guides/porting_guide_2.8.rst b/docs/docsite/rst/porting_guides/porting_guide_2.8.rst index 2bd73b2014..04770b9acb 100644 --- a/docs/docsite/rst/porting_guides/porting_guide_2.8.rst +++ b/docs/docsite/rst/porting_guides/porting_guide_2.8.rst @@ -20,6 +20,26 @@ Playbook No notable changes. +Command Line +============ + +Become Prompting +---------------- + +Beginning in version 2.8, by default Ansible will use the word ``BECOME`` to prompt you for a password for elevated privileges (``sudo`` privileges on unix systems or ``enable`` mode on network devices): + +By default in Ansible 2.8:: + + ansible-playbook --become --ask-become-pass site.yml + BECOME password: + +If you want the prompt to display the specific ``become_method`` you're using, instead of the agnostic value ``BECOME``, set :ref:`AGNOSTIC_BECOME_PROMPT` to ``False`` in your Ansible configuration. + +By default in Ansible 2.7, or with ``AGNOSTIC_BECOME_PROMPT=False`` in Ansible 2.8:: + + ansible-playbook --become --ask-become-pass site.yml + SUDO password: + Deprecated ========== diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 9a0681d482..14fd9f9ef3 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -160,9 +160,8 @@ BECOME_ALLOW_SAME_USER: type: boolean yaml: {key: privilege_escalation.become_allow_same_user} AGNOSTIC_BECOME_PROMPT: - # TODO: Switch the default to True in either the Ansible 2.6 release or the 2.7 release, whichever happens after the Tower 3.3 release name: Display an agnostic become prompt - default: False + default: True type: boolean description: Display an agnostic become prompt instead of displaying a prompt containing the command line supplied become method env: [{name: ANSIBLE_AGNOSTIC_BECOME_PROMPT}]