我在我的游戏手册中有一本可供选择的藏品,如下所示:
- name: Create a profile for the user
community.windows.win_user_profile:
username: test
name: test
state: present而这个集合是通过
ansible-galaxy collection install ansible.windows所以我可以在~/.可选/收藏处看到它。
不管我怎么说:
ERROR! couldn't resolve module/action 'community.windows.win_user_profile'. This often indicates a misspelling, missing collection, or incorrect module path.为了以防万一,我还把它复制到了剧本旁边,但仍然收到了同样的错误信息。
有什么建议吗?
发布于 2022-05-12 17:50:34
有两个Windows集合:社区和支持。我知道这很让人困惑:
看起来您已经安装了ansible.windows,尽管您使用的是community.windows
解决办法是:
ansible-galaxy collection install community.windows
发布于 2022-05-30 13:06:23
ansible 2.9使用不同的集合。一种方法是将它们添加到顶部:
---
- hosts: all
collections:
- community.windows然后稍后使用:
- name: Create a profile for the user
win_user_profile:
username: test
name: test
state: present供参考:
脏:不要这样做,但它是有效的。
ansible-config dump |grep DEFAULT_MODULE_PATH并在那里复制它们(例如替换路径和名称)..。
cp -p ~/.ansible/collections/ansible_collections/community/general/plugins/modules/system/sudoers.py ./library/发布于 2022-08-23 12:33:46
在安装community.general之后,我在Ubuntu20.04上的Ansible 2.9中也出现了同样的错误。本例中的解决方案是安装ansible.posix。
ansible-galaxy collection install ansible.posix因为它包含mount模块module.html
https://stackoverflow.com/questions/66335800
复制相似问题