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

fix: add check_mode to the checksum task #524

Merged

Conversation

santilococo
Copy link
Contributor

This PR adds the check_mode: false in the fetch checksum task.

This is needed because the next task, which parses the checksum list, expects the checksum files to already be downloaded. Without check_mode: false, the task only runs in "simulation" mode and doesn't download the files.

This "bug" was introduced during a refactor: 6209b53

Without check_mode: false:

TASK [prometheus.prometheus._common : Fetch checksum list for prometheus-2.48.1.linux-amd64.tar.gz] ***********************************************************************
skipping: [node]

TASK [prometheus.prometheus._common : Parse checksum list for prometheus-2.48.1.linux-amd64.tar.gz] ***********************************************************************
fatal: [node -> localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'content'. 'dict object' has no attribute 'content'\n\nThe error appears to be in '/home/slococo/.local/share/ansible/collections/ansible_collections/prometheus/prometheus/roles/_common/tasks/install.yml': line 95, column 11, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n        - name: \"Parse checksum list for {{ __common_binary_basename }}\"\n          ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote
template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}

With check_mode: false:

TASK [prometheus.prometheus._common : Fetch checksum list for prometheus-2.48.1.linux-amd64.tar.gz] ***********************************************************************
ok: [node -> localhost]

TASK [prometheus.prometheus._common : Parse checksum list for prometheus-2.48.1.linux-amd64.tar.gz] ***********************************************************************
ok: [node -> localhost]

Copy link
Member

@gardar gardar left a comment

Choose a reason for hiding this comment

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

Perhaps check_mode: false should be applied to the whole binary download block?

@santilococo
Copy link
Contributor Author

Perhaps check_mode: false should be applied to the whole binary download block?

We can do that as well.

@github-actions github-actions bot added bugfix and removed bugfix labels Jan 29, 2025
@gardar gardar linked an issue Jan 29, 2025 that may be closed by this pull request
Copy link
Member

@gardar gardar left a comment

Choose a reason for hiding this comment

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

Thanks!

@gardar gardar merged commit 21f7346 into prometheus-community:main Jan 29, 2025
667 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment