New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
offline role installation is not possible or documented #2030
Comments
Workaround-For: ansible/galaxy#2030 Fixes: ansible#2334 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Workaround-For: ansible/galaxy#2030 Fixes: ansible#2334 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Workaround-For: ansible/galaxy#2030 Fixes: #2334 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
You can simply pass in a list of tar files. Here's the instructions from
If you feel more examples in the docs would be helpful, please submit a PR to the Ansible project. |
@chouseknecht Maybe I was not clear that we are using requirements.yml files for testing and is impossible to switch to CLI on molecule, it would invalidate the entire idea of having requirements.yml files. I also updated the description, this bug needs to be reopen. |
Another issue is that apparently galaxy-install returns error if no roles are mentioned inside the requirements.yml file, this also closing another door related to testing. |
Should be re-opened, please re-read @chouseknecht. |
This issue needs to be opened at the Ansible project, as the |
🤦♂️ |
Fix bug where ansible-galaxy install would fail when given paths starting with tilde (user home). Related: ansible/galaxy#2030
Fix bug where ansible-galaxy install would fail when given paths starting with tilde (user home). Related: ansible/galaxy#2030
Fix bug where ansible-galaxy install would fail when given paths starting with tilde (user home). Related: ansible/galaxy#2030
Fix bug where ansible-galaxy install would fail when given paths starting with tilde (user home). Related: ansible/galaxy#2030
Fix bug where ansible-galaxy install would fail when given paths starting with tilde (user home). Related: ansible/galaxy#2030
When creating new ansible galaxy roles with a |
Initially raised as a question, but it seems to be more of a bug as the documentation does not state any way of installing a role from a local source.
Documentation of
requirements.yml
is very well hidden at https://docs.ansible.com/ansible/latest/reference_appendices/galaxy.html#installing-multiple-roles-from-a-file and does not give any example of using a local source, like afile://
url or something similar.There are multiple reasons for needing this:
This bus is also a blocker for changing default dependency installer in molecule from gilt to galaxy, because gilt works offline.
Update
The current specification of
requirements.yml
allows installing roles from localhost but only from full paths by using the undocumentedfile:///
scheme as src.Still this makes installation fully not portable, mainly impossible to install roles from current user directory. The
file://
scheme does not allow by design relative paths due to security concerns with browser use.Also there is no expansion of current user home directory, or even CWD, both of them being needed in order to be able to implement a portable offline installation.
When no uri prefix is given, galaxy assumes that the roles are from galaxy. Maybe we can sort this issue by looking if string starts with
./
or~
and assume is a local file path. I guess this should not conflict with galaxy role naming conventions.This caused ansible/molecule#2334 where on molecule we are forced to disable any testing of galaxy-install because testing it does trigger GitHub DDOS protection mechanisms and instead of downloading the very small test role we get HTTP 500 errors.
STEPS TO REPRODUCE
EXPECTED RESULTS
I would expect to allow users to install roles from disk using paths relative to home-dir, cwd or maybe even using jinja2 expansions (so we can lookup env).
The text was updated successfully, but these errors were encountered: