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 check_mode: false to Loki "Scrape GitHub" Task #262

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

winsmith
Copy link
Contributor

@winsmith winsmith commented Sep 2, 2024

When running in check mode, the grafana.grafana.loki role fails to execute because a variable is not set. Here is the error message:


TASK [grafana.grafana.loki : Latest available Loki version] ********************
Friday 02 August 2024  13:07:53 +0000 (0:00:00.675)       0:00:18.734 ********* 
Friday 02 August 2024  13:07:53 +0000 (0:00:00.675)       0:00:18.733 ********* 
fatal: [172.31.28.208]: FAILED! => {}

MSG:

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'json'. 'dict object' has no attribute 'json'

The error appears to be in '/opt/github-runner/.ansible/collections/ansible_collections/grafana/grafana/roles/loki/tasks/deploy.yml': line 17, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


    - name: Latest available Loki version
      ^ here

I believe the first task in the role, Scrape Github API endpoint to obtain latest Loki version, should always be run, even in check mode.

This PR makes that change.

Fix #252 (comment)

@CLAassistant
Copy link

CLAassistant commented Sep 2, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@voidquark voidquark left a comment

Choose a reason for hiding this comment

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

Approved

@voidquark voidquark merged commit 81abade into grafana:main Sep 5, 2024
9 of 17 checks passed
This pull request was closed.
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.

Loki role fails in check mode
3 participants