ansible-galaxy的文档说明如下:
ansible-galaxy命令与Ansible捆绑在一起,您可以使用它从银河安装角色,或者直接从基于git的单片机安装角色。您还可以使用它在银河网站上创建新角色、删除角色或执行任务。
我正试图弄清楚如何能够“直接从基于git的SCM”安装一个Ansible集合。当我从Ansible 2.9.1在ansible-galaxy collections --help Catalina上运行MacOS时,我会看到以下内容:
usage: ansible-galaxy collection install [-h] [-s API_SERVER]
[--api-key API_KEY] [-c] [-v] [-f]
[-i] [-n | --force-with-deps]
[-p COLLECTIONS_PATH]
[-r REQUIREMENTS]
[collection_name [collection_name ...]]
positional arguments:
collection_name The collection(s) name or path/url to a tar.gz
collection artifact. This is mutually exclusive with
--requirements-file.
optional arguments:
-h, --help show this help message and exit
-s API_SERVER, --server API_SERVER
The Galaxy API server URL
--api-key API_KEY The Ansible Galaxy API key which can be found at
https://galaxy.ansible.com/me/preferences. You can
also use ansible-galaxy login to retrieve this key or
set the token for the GALAXY_SERVER_LIST entry.
-c, --ignore-certs Ignore SSL certificate validation errors.
-v, --verbose verbose mode (-vvv for more, -vvvv to enable
connection debugging)
-f, --force Force overwriting an existing role or collection
-i, --ignore-errors Ignore errors during installation and continue with
the next specified collection. This will not ignore
dependency conflict errors.
-n, --no-deps Don't download collections listed as dependencies.
--force-with-deps Force overwriting an existing collection and its
dependencies.
-p COLLECTIONS_PATH, --collections-path COLLECTIONS_PATH
The path to the directory containing your collections.
-r REQUIREMENTS, --requirements-file REQUIREMENTS
A file containing a list of collections to be
installed.我尝试为GitHub参数指定一个-p存储库URI,但是ansible-galaxy试图查找一个名为URI的子文件夹,而不是识别一个有效的URI。
ansible-galaxy collection install -p https://github.com/pcgeek86/ansible-galaxy-test trevor.trevormacos我的期望是,为GitHub参数指定一个-p存储库URI应该正确地表明我希望从GitHub存储库中安装一个集合。
问题:如何指示ansible-galaxy直接从GitHub URI安装不可接受的集合
发布于 2020-07-27 15:02:14
由于最近的AnbleVersion2.10,这现在是可能的。
请参阅:https://github.com/ansible/ansible/pull/69154
要使用它,可以指定与角色类似的内容:
collections:
- name: git@github.com:my_org/private_collections.git#/path/to/collection,devel
- name: https://github.com/ansible-collections/amazon.aws.git
type: git
version: 8102847014fd6e7a3233df9ea998ef4677b99248https://stackoverflow.com/questions/59003007
复制相似问题