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

Update Debian apt cache when packages are not installed #167

Closed
widhalmt opened this issue May 22, 2023 · 3 comments · Fixed by #179
Closed

Update Debian apt cache when packages are not installed #167

widhalmt opened this issue May 22, 2023 · 3 comments · Fixed by #179
Assignees
Labels
feature New feature or request
Milestone

Comments

@widhalmt
Copy link
Member

I'm not as used to Debian as I'm used to RedHat, so take this with a grain of salt: Should we update apt cache before installing the packages? There are similar tasks in out Molecule checks but not in the actual roles.

In https://github.com/geerlingguy/ansible-role-mysql @geerlingguy has a task that checks whether the package is already installed. And if not, then her refreshes the apt cache. Should speed up the process significantly.

@widhalmt widhalmt added the feature New feature or request label May 22, 2023
@widhalmt widhalmt added this to the 1.1.0 milestone May 22, 2023
@afeefghannam89
Copy link
Member

We should update the cache if we want to install an actual package or update an existed one. Debian does not know about the new available packages without cache update. We can also integrate the cache update in the installation task.

@widhalmt
Copy link
Member Author

Yes. How about opening an issue or even a project/milestone for updating? And for now we check whether it's installed and if not, we run the cache update? Would that be ok? We need to keep the update in the Molecule configuration because that's for a different set of packages.

@afeefghannam89
Copy link
Member

ok, I agree with you

@widhalmt widhalmt self-assigned this Jun 15, 2023
widhalmt added a commit that referenced this issue Jun 15, 2023
I know, checking for the existence of the configuration directory is not
the best way. But it's way faster than quering the package manager every
time.

fixes #167
github-merge-queue bot pushed a commit that referenced this issue Oct 17, 2023
Run an apt refresh at the start of each role. We can use grace time so
we don't neet to refresh it every time and safe some time.

fixes #167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants