Skip to content

[Bug]: Improve support for Ansible 2.19, remove template delimiters and assess variable precidence and processing. #64

@trfore

Description

@trfore

What happened?

PR #62 covers this issue.

The suggested fix works in the default testing scenarios, however, the following errors occur during the listed scenarios:

SSH test

Problem lines are in roles/step_cert/tasks/certs.yml

TASK [trfore.smallstep.step_cert : Certs | Check Required Variables] ***********
[ERROR]: Task failed: Action failed: item.name needs to be set for the role to work
Origin: /home/trf/Documents/code/devops/ansible-public-repos/ansible-smallstep/.tox/py3.11-ansible2.19-ssh/.ansible/collections/ansible_collections/trfore/smallstep/roles/step_cert/tasks/certs.yml:2:3

1 ---
2 - name: Certs | Check Required Variables
    ^ column 3

failed: [ca-client-py3.11-ansible2.19-ssh] (item=item.name) => {"ansible_loop_var": "req_var", "assertion": "lookup('vars', req_var, default='') | length > 0", "changed": false, "evaluated_to": false, "msg": "item.name needs to be set for the role to work", "req_var": "item.name"}

Multi-cert test

Problem lines are in roles/step_provisioner/tasks/main.yml

TASK [trfore.smallstep.step_provisioner : Add provisioner to step-ca] **********
[ERROR]: Task failed: Finalization of task args for 'ansible.builtin.command' failed: Error while resolving value for '_raw_params': object of type 'dict' has no attribute 'ssh'

Task failed.
Origin: /home/trf/Documents/code/devops/ansible-public-repos/ansible-smallstep/.tox/py3.11-ansible2.19-multi/.ansible/collections/ansible_collections/trfore/smallstep/roles/step_provisioner/tasks/main.yml:30:3

28     jmesquery: "authority.provisioners[*].type"
29
30 - name: Add provisioner to step-ca
     ^ column 3

<<< caused by >>>

Finalization of task args for 'ansible.builtin.command' failed.
Origin: /home/trf/Documents/code/devops/ansible-public-repos/ansible-smallstep/.tox/py3.11-ansible2.19-multi/.ansible/collections/ansible_collections/trfore/smallstep/roles/step_provisioner/tasks/main.yml:32:3

30 - name: Add provisioner to step-ca
31   when: item.type|lower not in provisioners|lower
32   ansible.builtin.command: >-
     ^ column 3

<<< caused by >>>

Error while resolving value for '_raw_params': object of type 'dict' has no attribute 'ssh'
Origin: /home/trf/Documents/code/devops/ansible-public-repos/ansible-smallstep/.tox/py3.11-ansible2.19-multi/.ansible/collections/ansible_collections/trfore/smallstep/roles/step_provisioner/tasks/main.yml:32:28

30 - name: Add provisioner to step-ca
31   when: item.type|lower not in provisioners|lower
32   ansible.builtin.command: >-
                              ^ column 28

failed: [ca-server-py3.11-ansible2.19-multi] (item=(censored due to no_log)) => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}
[ERROR]: Task failed: Finalization of task args for 'ansible.builtin.command' failed: Error while resolving value for '_raw_params': object of type 'dict' has no attribute 'renewal_after_expiry'

Task failed.
Origin: /home/trf/Documents/code/devops/ansible-public-repos/ansible-smallstep/.tox/py3.11-ansible2.19-multi/.ansible/collections/ansible_collections/trfore/smallstep/roles/step_provisioner/tasks/main.yml:30:3

28     jmesquery: "authority.provisioners[*].type"
29
30 - name: Add provisioner to step-ca
     ^ column 3

<<< caused by >>>

Finalization of task args for 'ansible.builtin.command' failed.
Origin: /home/trf/Documents/code/devops/ansible-public-repos/ansible-smallstep/.tox/py3.11-ansible2.19-multi/.ansible/collections/ansible_collections/trfore/smallstep/roles/step_provisioner/tasks/main.yml:32:3

30 - name: Add provisioner to step-ca
31   when: item.type|lower not in provisioners|lower
32   ansible.builtin.command: >-
     ^ column 3

<<< caused by >>>

Error while resolving value for '_raw_params': object of type 'dict' has no attribute 'renewal_after_expiry'
Origin: /home/trf/Documents/code/devops/ansible-public-repos/ansible-smallstep/.tox/py3.11-ansible2.19-multi/.ansible/collections/ansible_collections/trfore/smallstep/roles/step_provisioner/tasks/main.yml:32:28

30 - name: Add provisioner to step-ca
31   when: item.type|lower not in provisioners|lower
32   ansible.builtin.command: >-
                              ^ column 28

failed: [ca-server-py3.11-ansible2.19-multi] (item=(censored due to no_log)) => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}
failed: [ca-server-py3.11-ansible2.19-multi] (item=(censored due to no_log)) => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}

Relevant code or playbook

Relevant log output

Ansible version

No response

Control node OS

No response

Target node OS

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions