StackStorm-Exchange / stackstorm-ansible

st2 content pack containing ansible integrations
https://exchange.stackstorm.org/
Apache License 2.0
36 stars 28 forks source link

How to install collection ? #49

Open VladoPortos opened 3 years ago

VladoPortos commented 3 years ago

Hello, How would I install collection so it can be used with stackstorm-ansible integration ? ( I'm running stackstorm in docker, but also on bare metal... )

VladoPortos commented 3 years ago

Also the ansible.galaxy.list is not working, it ends up with:

[WARNING]: - the configured path /root/.ansible/roles does not exist.
usage: ansible-galaxy [-h] [--version] [-v] TYPE ...
[WARNING]: - the configured path /usr/share/ansible/roles does not exist.

[WARNING]: - the configured path /etc/ansible/roles does not exist.
Perform various Role and Collection related operations.
ERROR! - None of the provided paths were usable. Please specify a valid path with --roles-path

positional arguments:
  TYPE
Executed command "/opt/stackstorm/virtualenvs/ansible/bin/ansible-galaxy list"
    collection   Manage an Ansible Galaxy collection.
    role         Manage an Ansible Galaxy role.

optional arguments:
  --version      show program's version number, config file location,
                 configured module search path, module location, executable
                 location and exit
  -h, --help     show this help message and exit
  -v, --verbose  verbose mode (-vvv for more, -vvvv to enable connection
                 debugging)

/opt/stackstorm/virtualenvs/ansible/bin/ansible-galaxy list is not valid command, it should be: /opt/stackstorm/virtualenvs/ansible/bin/ansible-galaxy collection list

arm4b commented 2 years ago

It needs a new action as collections weren't available when the pack was initially developed. Ansible pack is just a wrapper around the ansible CLI, so it's pretty simple to add. Example: https://github.com/StackStorm-Exchange/stackstorm-ansible/blob/master/actions/galaxy.list.yaml https://github.com/StackStorm-Exchange/stackstorm-ansible/blob/master/actions/ansible_galaxy.py

Contributions are welcome to support the new command.

0lzi commented 1 year ago

I have worked out a way to do this thanks to @geerlingguy. Ansible 101 - EP 13 - Ansible Collections and Test Plugin