Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

[fix] Update apt-cache before installing dependencies #205

Merged
merged 2 commits into from
Mar 1, 2020

Conversation

obitech
Copy link
Contributor

@obitech obitech commented Feb 25, 2020

Updates the apt cache before installing Grafana dependencies
through the package manager. This resolves a bug where old dependencies,
or those with a changed name, would not be installed due to
the package manager not being able to find them.

Fixes #200
Ref #201

Copy link
Member

@paulfantom paulfantom left a comment

Choose a reason for hiding this comment

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

LGTM, but let's see if CI catches anything.

@github-actions github-actions bot added the area/tasks Logic behind ansible role label Feb 25, 2020
@obitech
Copy link
Contributor Author

obitech commented Feb 25, 2020

Hmm it seems to fail at the pre-validate stage but I have trouble parsing the output. Any pointers?

Edit: maybe it's linting, I'm checking

Edit2: Seems to be linting but I'm not sure where exactly it fails:

ERROR: Failed to pre-validate.
{'lint': ['must be of string type']}
ERROR: InvocationError for command /home/travis/build/cloudalchemy/ansible-grafana/.tox/py37-ansible27/bin/molecule test -s default --destroy always (exited with code 1)

I've ran ansible-lint and yamlint on the changed file but nothing came up. Any ideas?

@paulfantom
Copy link
Member

paulfantom commented Feb 26, 2020

The issue is with molecule itself. More in cloudalchemy/skeleton#5. You can port that fix here and it should work.

@obitech
Copy link
Contributor Author

obitech commented Feb 26, 2020

I've migrated the changes but now there are a lot of warnings and errors from yamlint in different files. Let's see what CI says

Edit: I'd be happy to fix them but let me know how to handle the docker module exception

@github-actions github-actions bot added the area/tests Everything related to molecule tests and linters label Feb 26, 2020
@paulfantom
Copy link
Member

Seems like migration to molecule v3 might take more time than I though :(

Can you revert previous change and just pin molecule to version v2 in test-requirements.txt?
This would need just a change of one line to be like this one:

molecule>=2.15.0,<3.0.0

Sorry for those problems. I'll try to tackle it during weekend.

Updates the apt cache before installing Grafana dependencies
through the package manager. This resolves a bug where old dependencies,
or those with a changed name, would not be installed due to
the package manager not being able to find them.

Also pins molecule in test-requirements to less than v3
@obitech
Copy link
Contributor Author

obitech commented Feb 27, 2020

I've reverted and squashed commits.

Sorry for those problems. I'll try to tackle it during weekend.

No worries! Let me know if I can help with anything 🙂

@paulfantom
Copy link
Member

paulfantom commented Feb 27, 2020

Seems like tests don't like refreshing apt cache:

ERROR: Idempotence test failed because of the following tasks:

  • [xenial] => ansible-grafana : Update apt cache
  • [bionic] => ansible-grafana : Update apt cache

from https://travis-ci.com/cloudalchemy/ansible-grafana/jobs/291642777#L907

If this is necessary we might need to use apt module for installing grafana on debiand-based or apt-based systems and package module on others. However IMHO this is very "dirty" solution and should be avoided if possible.

Maybe we can move refreshing cache to block in which we set up GPG keys for repository?

@obitech
Copy link
Contributor Author

obitech commented Feb 28, 2020

If this is necessary we might need to use apt module for installing grafana on debiand-based or apt-based systems and package module on others. However IMHO this is very "dirty" solution and should be avoided if possible.

I agree, this is not something I'd want to do either.

Maybe we can move refreshing cache to block in which we set up GPG keys for repository?

If you mean the block later in the task, I don't think it works because apt cache needs to be refreshed before the dependencies are installed, right at the beginning. I've tried encapsulating the whole Install dependencies step as a block, let's see if that works.

Edit: looks good 🙂

@paulfantom paulfantom merged commit 13a6004 into cloudalchemy:master Mar 1, 2020
cosandr pushed a commit to cosandr/ansible-grafana that referenced this pull request Aug 12, 2020
* Update apt-cache before installing dependencies

Updates the apt cache before installing Grafana dependencies
through the package manager. This resolves a bug where old dependencies,
or those with a changed name, would not be installed due to
the package manager not being able to find them.

Also pins molecule in test-requirements to less than v3

* Move update cache in block with install dependencies
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tasks Logic behind ansible role area/tests Everything related to molecule tests and linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installation fails due to missing package libfontconfig on Ubuntu 18.04
2 participants