ansible批量安装nginx报错之一

wuchangjian2021-11-03 00:15:45编程学习

一下是报错:

fatal: [192.168.44.161]: FAILED! => {"changed": false, "msg": "No package matching 'nginx' found available, installed or updated", "rc": 126, "results": ["No package matching 'nginx' found available, installed or updated"]}

是因为192.168.44.161这台机子没有nginx源,添加nginx源就可以了。

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。