首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用可探测塔中的集合

如何使用可探测塔中的集合
EN

Server Fault用户
提问于 2021-12-14 23:53:18
回答 1查看 685关注 0票数 2

我们使用的是Ansible Tower 3.7.4,它有Ansible 2.9.13,我们还安装了“领班”的不可测集。

我的测试手册是

代码语言:javascript
复制
---
- 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命令向我显示已安装的路径:

代码语言:javascript
复制
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文件中:

代码语言:javascript
复制
grep collections /etc/ansible/ansible.cfg
collections_paths = /var/lib/awx/vendor/inventory_collections/ansible_collections

如何使用已安装的集合?

谢谢

EN

回答 1

Server Fault用户

回答已采纳

发布于 2021-12-15 07:16:21

ansible_collections是集合路径下目录结构的一部分,不应该包含在搜索路径中。

代码语言:javascript
复制
collections_paths = /var/lib/awx/vendor/inventory_collections
票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1086352

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档