Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cfbs.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@
"bundles powershell_execution_policy_inventory"
]
},
"package-method-ansible-galaxy-collection": {
"description": "Package method for installing Ansible Galaxy Collections.",
"subdirectory": "management/package-method-ansible-galaxy-collection",
"dependencies": [],
"steps": [
"directory ./ services/cfbs/modules/package-method-ansible-galaxy-collection/",
"policy_files services/cfbs/modules/package-method-ansible-galaxy-collection/"
]
},
"package-method-winget": {
"description": "Package method for Windows winget package manager.",
"subdirectory": "management/package-method-winget",
Expand Down
18 changes: 18 additions & 0 deletions management/package-method-ansible-galaxy-collection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# package-method-ansible-galaxy-collection

## Usage
This module enables a `ansible-galaxy-collection` package method used with policy like:

```cf3
packages:
"ansible.posix"
package_method => ansible_galaxy_collection,
package_policy => "add";
```

Note that there is not a command option in ansible-galaxy to uninstall collections so that will result in no changes being made and a warning message. Ansible documentation suggests [removing collections with rm](https://docs.ansible.com/projects/ansible/latest/collections_guide/collections_installing.html#removing-a-collection)

## Installation

This module does not ensure that needed ansible packages are installed to provide the `ansible-galaxy` command.
Typically this is a package named `ansible` on Debian-based distributions or `ansible-core` on RedHat-based distributions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
body package_method ansible_galaxy_collection
{
package_changes => "bulk";
package_name_convention => "$(name)";
package_delete_convention => "$(name)";

package_installed_regex => ".*";
package_list_name_regex => '^"([^"]*)",.*';
package_list_version_regex => '.*,"([^"]*)".*';


package_list_command => "ansible-galaxy collection list";
package_delete_command => 'echo "Deleting an Ansible Galaxy Collection is not supported"';
package_add_command => "ansible-galaxy collection install ";
}