$ ansible all -m ansible.builtin.shell -a 'echo $TERM'
ERROR! this task 'ansible.builtin.shell' has extra params, which is only
allowed in the following modules: import_role, win_command,
include_vars, include_tasks, raw, win_shell, command, add_host,
meta, include_role, shell, import_tasks, group_by, set_fact, script, include
누구든지 문제가 무엇인지 알아내도록 도와줄 수 있습니까?
태그가 -vvv
지정 되었습니다.
$ ansible -vvv centos -m ansible.builtin.shell -a 'echo $TERM'
ansible 2.9.6
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/chandru/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
ERROR! this task 'ansible.builtin.shell' has extra params, which is only allowed in the following modules: group_by, include_tasks, set_fact, raw, add_host, win_shell, win_command, include_vars, meta, import_role, command, script, include, shell, import_tasks, include_role
답변1
이는 FQCN으로의 전환의 일부로 도입된 Ansible의 버그로 인해 발생합니다.https://github.com/ansible/ansible/pull/71824
해결 방법으로 간단히 ansible.builtin.shell
이전 학교 shell
이름으로 바꿀 수 있습니다.
답변2
시도해 볼 수 있습니다.
$ ansible all -m shell -a 'echo $TERM'
내 환경:
root@ubuntu:~/ansiblelearn# ansible --version
ansible 2.9.6
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]