rh-ecosystem-edge / ansible-ai-playbook

Apache License 2.0
2 stars 7 forks source link

[Error] In role `setup-pxe` while executing the task `install tftp services` #11

Closed DirectedSoul1 closed 2 years ago

DirectedSoul1 commented 2 years ago

While running the setup-pxe role, the task fails showing error

fatal: [localhost]: FAILED! => {
    "msg": "The conditional check 'IPXE is True' failed. The error was: template error while templating string: no test named 'True'. String: {% if IPXE is True %} True {% else %} False {% endif %}\n\nThe error appears to be in '/root/ansible-ai-playbook/roles/setup-pxe/tasks/main.yml': line 6, 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: install tftp services\n  ^ here\n"
}

The task shows conditionals as

- name: install tftp services
  include_tasks: tftp.yml
  tags: install, tftp
  when: IPXE is True

This can be solved by changing the when: IPXE is True to when: IPXE is defined , a small conditional var change fixes the issue,

PLAY RECAP ***************************************************************************************************************************************************
localhost                  : ok=11   changed=5    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

I will be adding a PR fix for the same.