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

Deprecation warning when using "sudo_flags" in ansible.cfg #47006

Closed
cubranic opened this issue Oct 13, 2018 · 3 comments

Comments

@cubranic
Copy link

@cubranic cubranic commented Oct 13, 2018

SUMMARY

Using "sudo_flags" in my ansible.cfg causes the following warning to always be displayed when I run my playbooks:

[DEPRECATION WARNING]: DEFAULT_SUDO_FLAGS option, In favor of become which is a generic framework . This feature
will be removed in version 2.8. Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.

First, I only use "become: yes" in my playbooks already. The only reason why I had to override sudo_flags is to include "-E" so I can git-clone as root but using my local user's ssh key.

I don't think the warning is fair, for lack of better word: there is no other way to specify sudo flags -- become_flags does not exist, or at least I cannot just rename sudo_flags to become_flags and expect everything to work the same way.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible-playbook

ANSIBLE VERSION
ansible-playbook 2.4.2.0
  config file = /Users/davor/projects/monitoring/frb_ansible/ansible.cfg
  configured module search path = [u'/Users/davor/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.4.2.0_1/libexec/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 2.7.14 (default, Sep 25 2017, 09:53:22) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
CONFIGURATION
ANSIBLE_SSH_ARGS(XXX/ansible.cfg) = -o ForwardAgent=yes
DEFAULT_MANAGED_STR(XXX/ansible.cfg) = Ansible managed, do not edit directly
DEFAULT_SUDO_FLAGS(XXX/ansible.cfg) = -H -E
DEFAULT_TRANSPORT(XXX/ansible.cfg) = ssh
OS / ENVIRONMENT

macOS 10.12.6

STEPS TO REPRODUCE

Any ansible command: ansible foo -m ping

EXPECTED RESULTS

No warning.

ACTUAL RESULTS

Warning

@ansibot

This comment has been minimized.

Copy link
Contributor

@ansibot ansibot commented Oct 13, 2018

Hi @cubranic, thank you for submitting this issue!

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

@ansibot ansibot commented Oct 13, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@sivel

This comment has been minimized.

Copy link
Member

@sivel sivel commented Oct 15, 2018

As documented in the configuration settings, become_flags exists under the privilege_escalation section, whereas sudo_flags could exist under the defaults section:

https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-become-flags

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this Oct 15, 2018
@sivel sivel removed the needs_triage label Oct 15, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.