请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

-bash: ansible-playbook: command not found安装了为什么找不到这个命令?

requirements.txt

ansible2.9.16
jinja22.11.1
netaddr0.7.19
pbr5.4.4
jmespath0.9.5
ruamel.yaml0.16.10

pip3.6 install -r requirements.txt

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly.
Requirement already satisfied: ansible2.9.16 in /usr/local/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (2.9.16)
Requirement already satisfied: jinja22.11.1 in /usr/local/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (2.11.1)
Requirement already satisfied: netaddr0.7.19 in /usr/local/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (0.7.19)
Requirement already satisfied: pbr5.4.4 in /usr/local/lib/python3.6/site-packages (from -r requirements.txt (line 4)) (5.4.4)
Requirement already satisfied: jmespath0.9.5 in /usr/local/lib/python3.6/site-packages (from -r requirements.txt (line 5)) (0.9.5)
Requirement already satisfied: ruamel.yaml0.16.10 in /usr/local/lib/python3.6/site-packages (from -r requirements.txt (line 6)) (0.16.10)
Requirement already satisfied: PyYAML in /usr/local/lib64/python3.6/site-packages (from ansible2.9.16->-r requirements.txt (line 1)) (5.4.1)
Requirement already satisfied: cryptography in /usr/local/lib64/python3.6/site-packages (from ansible2.9.16->-r requirements.txt (line 1)) (3.4.7)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib64/python3.6/site-packages (from jinja22.11.1->-r requirements.txt (line 2)) (2.0.1)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2 in /usr/local/lib64/python3.6/site-packages (from ruamel.yaml0.16.10->-r requirements.txt (line 6)) (0.2.6)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib64/python3.6/site-packages (from cryptography->ansible2.9.16->-r requirements.txt (line 1)) (1.14.6)
Requirement already satisfied: pycparser in /usr/local/lib/python3.6/site-packages (from cffi>=1.12->cryptography->ansible2.9.16->-r requirements.txt (line 1)) (2.20)
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

ansible-playbook -i inventory/mycluster/hosts.yaml -b cluster.yml -vvvv

-bash: ansible-playbook: command not found

正在回答 回答被采纳积分+3

1回答

刘果国 2021-08-11 06:03:11

基础问题建议自己多动手哈。百度一个资料供参考:https://serverfault.com/questions/1007835/bash-ansible-playbook-command-not-found

1 回复 有任何疑惑可以回复我~
  • 提问者 慕侠0397330 #1
    感谢老师回答
    回复 有任何疑惑可以回复我~ 2021-08-11 08:00:53
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信