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

Error on Inherit Default Vars #320

Open
gene-redpanda opened this issue Feb 4, 2025 · 5 comments
Open

Error on Inherit Default Vars #320

gene-redpanda opened this issue Feb 4, 2025 · 5 comments

Comments

@gene-redpanda
Copy link

gene-redpanda commented Feb 4, 2025

Hi, getting an error running your Grafana role. Here is the playbook:

Here is the full CI output with the error


PLAY [Install grafana] *********************************************************
  |  
  | TASK [grafana.grafana.grafana : Inherit default vars] **************************
  | fatal: [52.41.245.240]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'grafana_ini' is undefined. 'grafana_ini' is undefined\n\nThe error appears to be in '/workdir/artifacts/collections/ansible_collections/grafana/grafana/roles/grafana/tasks/main.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Inherit default vars\n  ^ here\n"}
  |  
  | PLAY RECAP *********************************************************************
  | 44.244.90.70               : ok=14   changed=6    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
  | 44.245.11.142              : ok=15   changed=6    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
  | 52.41.245.240              : ok=64   changed=24   unreachable=0    failed=1    skipped=18   rescued=0    ignored=0
  | 54.188.230.173             : ok=14   changed=6    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
 

And here is the playbook where we consume the role

https://github.com/redpanda-data/deployment-automation/blob/main/ansible/deploy-monitor.yml

And this is the task where the error is happening in your role

grafana_ini: "{{ grafana_ini_default | ansible.builtin.combine(grafana_ini, recursive=true) }}"

We're not using grafana_ini at the moment and it fails on the task that works out whether or not to use the defaults. I suspect if I you initialize it as an empty dict that will satisfy the copy and then I can use the defaults as before.

Here is the suggested fix in code form:

- name: Inherit default vars
  ansible.builtin.set_fact:
    grafana_ini: "{{ grafana_ini_default | ansible.builtin.combine(grafana_ini | default({}), recursive=true) }}"
@ee-simon
Copy link

ee-simon commented Feb 6, 2025

Same here.

Using 5.6.0 release seems to work, waiting for a fix.

@gregharvey
Copy link

gregharvey commented Feb 7, 2025

Hmm, also getting it with 5.6.0 here. 🤔

My bad, container had not yet rebuilt. 🙄

@intermittentnrg
Copy link
Contributor

Did you set the new grafana_ini variable in grafana role 5.7.0?

See variables in README. This was changed by issue #210 and PR #232

@gene-redpanda
Copy link
Author

@intermittentnrg Yes, tried that and ran into another issue. Decided to pin and skip further investigation.

gene-redpanda added a commit to redpanda-data/deployment-automation that referenced this issue Feb 10, 2025
There's a bug in the latest grafana role that causes issues with deploying it as part of testing. I've pinned to 5.6.0 until they've resolved the issue

grafana/grafana-ansible-collection#320
@intermittentnrg
Copy link
Contributor

Ok then. So issue resolved? Or do we need to provide a more helpful error message when grafana_ini is not set.

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

No branches or pull requests

4 participants