Ansible 2.9.10 error: "msg" "Invalid become method specified, could not find matching plugin: 'disable'

Ansible 2.9.10 error: "msg" "Invalid become method specified, could not find matching plugin: 'disable'

在 运行使用 YML Ansible Playbook 时,出现以下错误。

fatal: [192.168.0.120]: FAILED! => {"msg": "Invalid become method specified, could not find matching plugin: 'disable'. Use `ansible-doc -t become -l` to list available plugins."}

我的 Ansible 文件很简单

- name: CONFIG FGT HOSTNAME AND INTERFACE
  hosts: FortiManager
  connection: httpapi
  gather_facts: False

  tasks:

  - name: CONFIRM AUTHORIZE UNAUTHORIZED FMG DEVICE
    pause:
      prompt: "Do you want to add FGT-ISFW as an authorized device?"
      echo: "yes"

我运行“ansible-doc -t become -l”命令,但我没有看到任何与消息相关的信息,我不确定下一步该做什么。

# ansible-doc -t become -l enable
ksu        Kerberos substitute user
pbrun      PowerBroker run
enable     Switch to elevated permissions on a network device
sesu       CA Privileged Access Manager
pmrun      Privilege Manager run
runas      Run As user
sudo       Substitute User DO
su         Substitute User
doas       Do As user
pfexec     profile based execution
machinectl Systemd's machinectl privilege escalation
dzdo       Centrify's Direct Authorize

有什么建议吗?我是 运行ning Ansible 2.9.10

# ansible --version
ansible 2.9.10
  config file = /home/fortinet/downloads/FMG-Ansible-Testing/ansible.cfg
  configured module search path = [u'/opt/ansible/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0]

Q: "FAILED! => {"msg": "Invalid become method specified, could not find matching plugin: 'disable'.}"

答:根据错误提示,是misconfiguration. There is no disable become plugin。比如这个是错误的

    become_method: disable

禁用privilege escalation use DEFAULT_BECOME。例如(这是默认值)

    become: false

困难的部分是找到错误配置的来源。您正在寻找 DEFAULT_BECOME_METHOD。看看配置

shell> ansible-config dump --changed-only

如果没有,请查看库存,group_vars,和 host_vars。搜索 become_method.