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
    • 最新
    • 标签
主页 / user-1087211

Dave Dribin's questions

Martin Hope
Dave Dribin
Asked: 2024-05-07 09:42:00 +0800 CST

Ansible Lint 未找到 Homebrew 安装的 Ansible 中包含的community.general

  • 5

我遇到 Ansible Lint 未找到community.general模块的问题:

> ansible-lint <redacted>.yml
WARNING  Listing 1 violation(s) that are fatal
syntax-check[unknown-module]: couldn't resolve module/action 'community.general.locale_gen'. This often indicates a misspelling, missing collection, or incorrect module path.
<readacted>.yml:16:3

这个动作是:

- name: Set locale
  community.general.locale_gen:
    name: en_US.UTF-8

我使用的是 macOS Sonoma 14.4.1,并且我已经通过Homebrew安装了 Ansible (版本详细信息在最后)。据我所知,这包括许多社区模块,而无需通过 Ansible Galaxy 安装它们:

> ansible-galaxy collection list | grep community.general
community.general                        8.6.0

所以剧本运行得很好,但ansilbe-lint找不到模块。


我确实在顶部注意到了这一点ansible-galaxy collection list:

# /opt/homebrew/Cellar/ansible/9.5.1/libexec/lib/python3.12/site-packages/ansible_collections
Collection                               Version
---------------------------------------- -------

如果我设置ANSIBLE_COLLECTIONS_PATH为该/opt/homebrew/.../ansible_collections路径,那么它就可以工作。但我似乎不必这样做?如果ansible-playbook能找到,为什么找不到ansible-lint?如何自动ansible-lint查找内置集合路径?


版本信息:

> ansible --version
ansible [core 2.16.6]
  config file = /Users/dave/work/ansible/dribin-infra/ansible.cfg
  configured module search path = ['/Users/dave/work/ansible/dribin-infra/library']
  ansible python module location = /opt/homebrew/Cellar/ansible/9.5.1/libexec/lib/python3.12/site-packages/ansible
  ansible collection location = /Users/dave/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.12.3 (main, Apr  9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)] (/opt/homebrew/Cellar/ansible/9.5.1/libexec/bin/python)
  jinja version = 3.1.3
  libyaml = True
==> ansible: stable 9.5.1 (bottled), HEAD
Automate deployment, configuration, and upgrading
https://www.ansible.com/
Installed
/opt/homebrew/Cellar/ansible/9.5.1 (31,927 files, 365.5MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-04-26 at 23:40:10
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/ansible.rb
...
mac-osx
  • 1 个回答
  • 84 Views

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