ansible 报错解决:ERROR! this task '****' has extra params, which is only allowed in the following modules:..

 

这个问题一般是模块参数的问题,仔细核对一下模块的参数。

 

 

少baseurl参数
#!/bin/bash
ansible all -m yum_repository  -a 'name=abc description=abcabc file=test baseurl=http://study.lab0.example.com/rhel8/BaseOS gpgcheck=yes gpgkey=http://study.lab0.example.com/rhel8/RPM-GPG-KEY-redhat-release'

ansible all -m yum_repository  -a 'name=abc01 description="abc abc" file=test01 baseurl=http://study.lab0.example.com/rhel8/AppStream  gpgcheck=yes gpgkey=http://study.lab0.example.com/rhel8/RPM-GPG-KEY-redhat-release'

~                                                                          
~                                                                          
~                                                                          
~                              

 

 

 

posted @ 2021-02-21 23:03  山河已无恙  阅读(4628)  评论(0编辑  收藏  举报