AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1086352
Accepted
user1174838
user1174838
Asked: 2021-12-15 15:53:18 +0800 CST2021-12-15 15:53:18 +0800 CST 2021-12-15 15:53:18 +0800 CST

如何在 Ansible Tower 中使用集合

  • 772

我们正在使用具有 Ansible 2.9.13 的 Ansible Tower 3.7.4,我们还安装了“theforeman”ansible 集合。

我的测试剧本是

---
- 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'还是只使用'host',都报告“错误!无法解析模块/操作”

定位命令显示安装路径:

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

如何使用已安装的集合?

谢谢

ansible
  • 0 0 个回答
  • 426 Views

0 个回答

  • Voted
  1. Best Answer
    flowerysong
    2021-12-15T23:16:21+08:002021-12-15T23:16:21+08:00

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

    collections_paths = /var/lib/awx/vendor/inventory_collections
    
    • 2

相关问题

  • Ansible:将字符串转换为字典

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve