我们使用的是Ansible Tower 3.7.4,它有Ansible 2.9.13,我们还安装了“领班”的不可测集。
我的测试手册是
---
- name: Test foreman roles
hosts: localhost
become: false
gather_facts: false
tasks:
- add_host:
name: victim.local
group: my_inv
- name: Test foreman roles
hosts: my_inv
become: false
gather_facts: false
tasks:
- theforeman.foreman.host:
server_url: "https://foreman-server.local"
username: "admin"
password: "password"
parameters:
name: "param_name"
value: "param_value"
parameter_type: "string"
delegate_to: localhost无论我使用'theforeman.foreman.host‘还是只使用’主机‘,都报告“错误!无法解决模块/操作”
locate命令向我显示已安装的路径:
locate theforeman | grep host
/var/lib/awx/vendor/inventory_collections/ansible_collections/theforeman/foreman/plugins/modules/foreman_host.py
/var/lib/awx/vendor/inventory_collections/ansible_collections/theforeman/foreman/plugins/modules/foreman_host_power.py
/var/lib/awx/vendor/inventory_collections/ansible_collections/theforeman/foreman/plugins/modules/foreman_hostgroup.py
/var/lib/awx/vendor/inventory_collections/ansible_collections/theforeman/foreman/plugins/modules/katello_host_collection.py我把它放到了ansible.cfg文件中:
grep collections /etc/ansible/ansible.cfg
collections_paths = /var/lib/awx/vendor/inventory_collections/ansible_collections如何使用已安装的集合?
谢谢
发布于 2021-12-15 07:16:21
ansible_collections是集合路径下目录结构的一部分,不应该包含在搜索路径中。
collections_paths = /var/lib/awx/vendor/inventory_collectionshttps://serverfault.com/questions/1086352
复制相似问题