diff --git a/lib/ansible/playbook/become.py b/lib/ansible/playbook/become.py index b3f82270af3..e102dc8d3ab 100644 --- a/lib/ansible/playbook/become.py +++ b/lib/ansible/playbook/become.py @@ -93,12 +93,3 @@ class Become: display.deprecated("Instead of su/su_user, use become/become_user and set become_method to 'su' (default is sudo)", '2.6') return ds - - def set_become_defaults(self, become, become_method, become_user): - ''' if we are becoming someone else, but some fields are unset, - make sure they're initialized to the default config values ''' - if become: - if become_method is None: - become_method = C.DEFAULT_BECOME_METHOD - if become_user is None: - become_user = C.DEFAULT_BECOME_USER diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index 55d27077ed8..c8f6e55a75c 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -455,9 +455,6 @@ class PlayContext(Base): if new_info.no_log is None: new_info.no_log = C.DEFAULT_NO_LOG - # set become defaults if not previouslly set - task.set_become_defaults(new_info.become, new_info.become_method, new_info.become_user) - if task.always_run: display.deprecated("always_run is deprecated. Use check_mode = no instead.", version="2.4", removed=False) new_info.check_mode = False