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

Simplify package installation process #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

damiandabrowski5
Copy link

Currently, warn is passed to args argument in a few places. warn was removed in ansible 2.14[1] which makes it impossible to use ara_api role with ansible >=2.14.

Patch proposes an easier way to install required packages on all package managers and ensure that their cache is updated.

[1] ansible/ansible#70504

Currently, `warn` is passed to `args` argument in a few places.
`warn` was removed in ansible 2.14[1] which makes it impossible to use
ara_api role with ansible >=2.14.

Patch proposes an easier way to install required packages on all package
managers and ensure that their cache is updated.

[1] ansible/ansible#70504
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/c26e9045e55142f9ad8e9430491ff85d

ara-role-api-distributed-sqlite FAILURE in 11m 07s
ara-role-api-mysql FAILURE in 6m 23s
ara-role-api-postgresql FAILURE in 5m 52s
ara-role-api-gunicorn-nginx FAILURE in 7m 53s
ara-role-api-gunicorn-nginx-client-cert FAILURE in 8m 06s
ara-role-api-fedora-packages FAILURE in 4m 50s (non-voting)

@dmsimard
Copy link
Contributor

Hi @damiandabrowski5 and thanks for the PR!

We're in the middle of refreshing the collection as it ran out of maintenance so it will be a good idea to include something like this as well.

My priority is to land #71 first which will get the CI back in shape and we will eventually circle back to this.

Thanks for your patience in the meantime.

Thulium-Drake added a commit to Thulium-Drake/ara-collection that referenced this pull request Apr 2, 2024
set_fact:
ara_api_missing_packages: "{{ ara_api_required_packages | difference(ansible_facts['packages'].keys()) }}"

# Only attempt to elevate privileges if there are any missing packages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not remove the logic around detecting whether or not packages are already installed and the reason why is in that comment.

In other words, the role is designed to be executable under an unprivileged user if the necessary packages have already been installed: ara can be set up and run within a user's home directory without relying on root or sudo privileges.

By removing this logic, ansible will try to elevate privileges (become: true) and it will not work if Ansible isn't running with root or sudo.

We can remove warn: false if it is an issue, which leaves the fix looking like this instead: Thulium-Drake@91ae432 (thanks @Thulium-Drake).

@dmsimard
Copy link
Contributor

Hi @damiandabrowski5, sorry for the delay.

I hope my explanation makes sense. We can either update this PR or submit a new one.

Let us know if you would like to do it or we can take care of it.

Thanks.

@damiandabrowski5
Copy link
Author

damiandabrowski5 commented Apr 22, 2024

@dmsimard thanks for an update, feel free to either update my PR or abandon it and create new one ;) I'm fine with both solutions

Thulium-Drake added a commit to Thulium-Drake/ara-collection that referenced this pull request Apr 29, 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