Skip to content
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

Add: flag "--force" as option in galaxy install process #2316

Closed
wants to merge 1 commit into from

Conversation

FactorT
Copy link

@FactorT FactorT commented Aug 29, 2024

Add posibillity to turn off flag "--force" in command ansible-galaxy install role/collection --force -r requirements.yml
Permanently flag "--force" may cause some problems with concurrent tasks. Because ansible removes installed roles\collections before new installation.
For example:

10:00:00am Task1 runs
10:01:20am Task1 starts galaxy role install process with flag "--force"
10:01:21am Task1 deletes installed roles
10:01:22am Task1 installs roles
10:01:30am Task1 runs playbook and prepares to use a some template from one of the installed roles.
10:02:00am Task2 runs
10:02:20am Task2 starts galaxy role install process with flag "--force"
10:02:21am Task2 deletes installed roles
10:02:22am Task1 tries to use a template from one of roles, but cannot find it and crashes with error
10:02:23am Task2 installs roles
10:02:30am Task2 runs playbook

Therefore, the ability to disable the flag "--force" is required to avoid deleting and installing already installed versions of roles/collections

@fiftin
Copy link
Collaborator

fiftin commented Sep 27, 2024

Hi @FactorT

Perhaps we need separate directory with installed galaxy roles/collections for each template?

PS:
I'm sure adding global flag for all templates is not the best idea. I remember how many requests I got for --force.

@FactorT
Copy link
Author

FactorT commented Oct 1, 2024

@fiftin do you mean we need to use flag:

-p ROLES_PATH, --roles-path ROLES_PATH
                        The path to the directory containing your roles. The default is the first writable one configured via DEFAULT_ROLES_PATH: {{ ANSIBLE_HOME ~
                        "/roles:/usr/share/ansible/roles:/etc/ansible/roles" }} . This argument may be specified multiple times.

for command ansible-galaxy install? And install all collections and roles into the corresponding template folder?
For example: /tmp/semaphore/repository_26_10/roles ?

@fiftin
Copy link
Collaborator

fiftin commented Oct 8, 2024

@FactorT yes, I think it can be used.

@fiftin fiftin closed this Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants