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

Loki role fails in check mode #252

Closed
winsmith opened this issue Aug 2, 2024 · 5 comments · Fixed by #262 · May be fixed by winsmith/grafana-ansible-collection#1
Closed

Loki role fails in check mode #252

winsmith opened this issue Aug 2, 2024 · 5 comments · Fixed by #262 · May be fixed by winsmith/grafana-ansible-collection#1

Comments

@winsmith
Copy link
Contributor

winsmith commented Aug 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 should fix the issue.

If requested, I'll gladly make a PR that adds check_mode: false to the task.

@voidquark
Copy link
Collaborator

Agreed, it should run in check mode. Could you please raise a PR?

@voidquark
Copy link
Collaborator

@winsmith any progress on this ?

@winsmith
Copy link
Contributor Author

winsmith commented Sep 2, 2024

@voidquark whoops! Here you go: #262

@x4e-jonas
Copy link

It is still failing but this time with

fatal: [***]: FAILED! => changed=false 
  msg: 'Could not find the requested service loki.service: host'

@x4e-jonas
Copy link

Added a fix for it in #266. Feel free to takeover from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants