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

ansible-galaxy install --force no longer replaces roles #74

Open
chouseknecht opened this issue Oct 13, 2017 · 4 comments
Open

ansible-galaxy install --force no longer replaces roles #74

chouseknecht opened this issue Oct 13, 2017 · 4 comments

Comments

@chouseknecht
Copy link
Contributor

From @jxn on April 13, 2017 18:10

After the version bump to 2.3.0, it seems install --force no longer forces an overwrite. We have been using this to "upgrade" roles stored in git, but they are no longer pulled in.

Here's the command used:
ansible-galaxy install --force -r ansible/requirements.yml -p ansible/roles/

Here's an example requirements.yml

---
- src: git@git.srv:ansible/linux-http.git
  scm: git
- src: git@git.srv:ansible/apache-php.git
  scm: git

Previously, when we pushed new role updates to master, these would be overwritten in the 'ansible/roles' directory with the above command. Now, these are not updated until we manually delete the roles in that folder. We get the following output:

- linux-http is already installed, skipping.
- apache-php is already installed, skipping.

As far as I can tell, force no longer does anything as of 2.3.0

Copied from original issue: ansible/galaxy-issues#249

@chouseknecht
Copy link
Contributor Author

Fixed in by Ansible PR #23391

@bittner
Copy link

bittner commented Feb 26, 2019

I believe, we still have a problem with "updating" using the --force option.

We have a situation in a cluster auto-update strategy that makes a playbook fail, because an ansible-galaxy install --force runs at the same time and the playbook doesn't find the related role:

...
The offending line appears to be:

      import_role:
        name: foo-server-bootstrap
              ^ here
...

This is due to the fact that --force replaces (removes and installs) the role no matter whether the latest version of the role is already installed.

Rather than --force we'd need an --update option for install that would verify whether a new version is available for installation before brute-force proceed on doing it.

Has something like that been discussed before? Is that maybe planned already?

@bittner
Copy link

bittner commented Feb 26, 2019

Related issues:

@C0rn3j
Copy link

C0rn3j commented Jan 7, 2022

I believe OP's issue been fixed at some point. Would still be nice to have the --update option.

ansible-galaxy role install -r /root/playbooks/requirements.yaml --force

Starting galaxy collection install process
Process install dependency map
Starting collection install process
'kewlfft.aur:0.10.0' is already installed, skipping.
Starting galaxy role install process
- changing role gantsign.visual-studio-code-extensions from 2.4.0 to unspecified
- downloading role 'visual-studio-code-extensions', owned by gantsign
- downloading role from https://github.com/gantsign/ansible-role-visual-studio-code-extensions/archive/2.4.0.tar.gz
- extracting gantsign.visual-studio-code-extensions to /root/.ansible/roles/gantsign.visual-studio-code-extensions
- gantsign.visual-studio-code-extensions (2.4.0) was installed successfully
- changing role geerlingguy.certbot from 4.1.0 to unspecified
- downloading role 'certbot', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-certbot/archive/5.0.0.tar.gz
- extracting geerlingguy.certbot to /root/.ansible/roles/geerlingguy.certbot
- geerlingguy.certbot (5.0.0) was installed successfully
- changing role geerlingguy.postgresql from 3.1.1 to unspecified
- downloading role 'postgresql', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-postgresql/archive/3.2.1.tar.gz
- extracting geerlingguy.postgresql to /root/.ansible/roles/geerlingguy.postgresql
- geerlingguy.postgresql (3.2.1) was installed successfully
# ansible --version     
ansible [core 2.12.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/sbin/ansible
  python version = 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0]
  jinja version = 3.0.3
  libyaml = True

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

No branches or pull requests

3 participants