Skip to content

Dry-Run with --check runs into Error #100

@mattagohni

Description

@mattagohni

Hi,
I just stumbled over a problem with this role, when running it with --check. It seems like, in this case the request to launchpad is skipped, because this task does not support check-mode.

TASK [geerlingguy.php-versions : Debug launchpad_response] *************************************************************************************
ok: [91.98.164.146] => {
    "launchpad_response": {
        "changed": false,
        "msg": "This action (uri) does not support check mode.",
        "skipped": true
    }
}

the next step accesses this variable and tries to read a value out of the json property which does not exist in this case.

TASK [geerlingguy.php-versions : Parse JSON to extract signing key fingerprint] ****************************************************************
[ERROR]: Task failed: Finalization of task args for 'ansible.builtin.set_fact' failed: Error while resolving value for 'signing_key_fingerprint': object of type 'dict' has no attribute 'json'

Task failed.
Origin: /home/mattagohni/.ansible/roles/geerlingguy.php-versions/tasks/setup-Debian.yml:29:3

27
28
29 - name: Parse JSON to extract signing key fingerprint
     ^ column 3

<<< caused by >>>

Finalization of task args for 'ansible.builtin.set_fact' failed.
Origin: /home/mattagohni/.ansible/roles/geerlingguy.php-versions/tasks/setup-Debian.yml:30:3

28
29 - name: Parse JSON to extract signing key fingerprint
30   ansible.builtin.set_fact:
     ^ column 3

<<< caused by >>>

Error while resolving value for 'signing_key_fingerprint': object of type 'dict' has no attribute 'json'
Origin: /home/mattagohni/.ansible/roles/geerlingguy.php-versions/tasks/setup-Debian.yml:31:30

29 - name: Parse JSON to extract signing key fingerprint
30   ansible.builtin.set_fact:
31     signing_key_fingerprint: "{{ launchpad_response.json.signing_key_fingerprint }}"
                                ^ column 30

fatal: [91.98.164.146]: FAILED! => {"changed": false, "msg": "Task failed: Finalization of task args for 'ansible.builtin.set_fact' failed: Error while resolving value for 'signing_key_fingerprint': object of type 'dict' has no attribute 'json'"}

I'm not sure how this could be fixed, but I wanted to highlight this.

My Ansible Setup looks like this:

ansible [core 2.19.3]
  config file = /home/mattagohni/projects/mattagohni-de/ansible.cfg
  configured module search path = ['/home/mattagohni/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.13/site-packages/ansible
  ansible collection location = /home/mattagohni/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.13.7 (main, Aug 15 2025, 12:34:02) [GCC 15.2.1 20250813] (/usr/bin/python)
  jinja version = 3.1.6
  pyyaml version = 6.0.3 (with libyaml v0.2.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions