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

Check mode is broken in 0.24.0 #525

Closed
erikgb opened this issue Jan 28, 2025 · 2 comments · Fixed by #524
Closed

Check mode is broken in 0.24.0 #525

erikgb opened this issue Jan 28, 2025 · 2 comments · Fixed by #524

Comments

@erikgb
Copy link

erikgb commented Jan 28, 2025

We always run our playbooks in check mode from feature branches, and it seems like version 0.24.0 broke this workflow. Should be fairly simple to fix, and I hope you want to support this workflow. The error:

TASK [prometheus.prometheus._common : Download blackbox_exporter-0.25.0.linux-amd64.tar.gz] ***
ok: [REDACTED -> localhost]
ok: [REDACTED -> localhost]
TASK [prometheus.prometheus._common : Fetch checksum list for blackbox_exporter-0.25.0.linux-amd64.tar.gz] ***
skipping: [REDACTED ]
TASK [prometheus.prometheus._common : Parse checksum list for blackbox_exporter-0.25.0.linux-amd64.tar.gz] ***
fatal: [REDACTED -> 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'
  
    The error appears to be in '/home/ansible/.ansible/collections/ansible_collections/prometheus/prometheus/roles/_common/tasks/install.yml': line 95, column 11, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
  
            - name: "Parse checksum list for {{ __common_binary_basename }}"
              ^ here
    We could be wrong, but this one looks like it might be an issue with
    missing quotes. Always quote template expression brackets when they
    start a value. For instance:
  
        with_items:
          - {{ foo }}
  
    Should be written as:
  
        with_items:
          - "{{ foo }}"

The fetch is skipped (because of running in check mode) - making the parse task fail. I would suggest forcing the fetch to also run in check mode, since it is not modifying anything, but open to other ways of fixing this.

@copolycube
Copy link

copolycube commented Jan 29, 2025

Hello,
I can confirm this on my side for alertmanager and prometheus

alertmanager :

TASK [prometheus.prometheus._common : Parse checksum list for alertmanager-0.27.0.linux-amd64.tar.gz] ***
Wednesday 29 January 2025  17:27:20 +0000 (0:00:00.064)       0:00:23.950 ***** 
Wednesday 29 January 2025  17:27:20 +0000 (0:00:00.064)       0:00:23.949 ***** 
fatal: [REDACTED -> localhost]: FAILED! => 
  msg: |-
    The task includes an option with an undefined variable.. 'dict object' has no attribute 'content'
  
    The error appears to be in 'ansible/vendor-collections/ansible_collections/prometheus/prometheus/roles/_common/tasks/install.yml': line 95, column 11, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
  
            - name: "Parse checksum list for {{ __common_binary_basename }}"
              ^ here
    We could be wrong, but this one looks like it might be an issue with
    missing quotes. Always quote template expression brackets when they
    start a value. For instance:
  
        with_items:
          - {{ foo }}
  
    Should be written as:
  
        with_items:
          - "{{ foo }}"

prometheus:

TASK [prometheus.prometheus._common : Parse checksum list for prometheus-3.1.0.linux-amd64.tar.gz] ***
Wednesday 29 January 2025  17:27:29 +0000 (0:00:00.066)       0:01:48.969 ***** 
Wednesday 29 January 2025  17:27:29 +0000 (0:00:00.066)       0:01:48.968 ***** 
fatal: [REDACTED -> localhost]: FAILED! => 
  msg: |-
    The task includes an option with an undefined variable.. 'dict object' has no attribute 'content'
  
    The error appears to be in 'ansible/vendor-collections/ansible_collections/prometheus/prometheus/roles/_common/tasks/install.yml': line 95, column 11, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
  
            - name: "Parse checksum list for {{ __common_binary_basename }}"
              ^ here
    We could be wrong, but this one looks like it might be an issue with
    missing quotes. Always quote template expression brackets when they
    start a value. For instance:
  
        with_items:
          - {{ foo }}
  
    Should be written as:
  
        with_items:
          - "{{ foo }}"
          - ```

@gardar
Copy link
Member

gardar commented Jan 29, 2025

There is a pending fix in #524

@gardar gardar linked a pull request Jan 29, 2025 that will close this issue
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 a pull request may close this issue.

3 participants