在Ansible中,将DEFAULT_SUDO_FLAGS更改为DEFAULT_BECOME_FLAGS

如果出现非推荐的警告,SUDO_FLAG将不再支持。

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

请修改 /etc/ansible/ansible.cfg。

*** sudo_flgas を コメントアウト ***

# What flags to pass to sudo
# WARNING: leaving out the defaults might create unexpected behaviours
#sudo_flags = -H -S -n

*** become_flags を 追記(もしくはコメント解除) ***

[privilege_escalation]
・・・
become_flags = -H -S -n

请确认是否没有收到警告。

# ansible-config dump --only-changed
・・・
DEFAULT_BECOME_FLAGS(/etc/ansible/ansible.cfg) = -H -S -n
・・・
广告
将在 10 秒后关闭
bannerAds