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

ocp_deprovision role error: ipi_platform is undefined #1217

Open
mudspringhiker opened this issue Feb 22, 2024 · 0 comments
Open

ocp_deprovision role error: ipi_platform is undefined #1217

mudspringhiker opened this issue Feb 22, 2024 · 0 comments

Comments

@mudspringhiker
Copy link
Contributor

When running ocp_deprovision for OCP in AWS, the following error occurred:

TASK [ibm.mas_devops.ocp_deprovision : ipi : Fail if required parameters are not provided (AWS)] ****************************
fatal: [localhost]: FAILED! =>
  msg: |-
    The conditional check 'ipi_platform == "aws"' failed. The error was: error while evaluating conditional (ipi_platform == "aws"): 'ipi_platform' is undefined. 'ipi_platform' is undefined

    The error appears to be in '/opt/app-root/lib64/python3.9/site-packages/ansible_collections/ibm/mas_devops/roles/ocp_deprovision/tasks/providers/ipi.yml': line 17, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    # that seems rather redundant at present.
    - name: "ipi : Fail if required parameters are not provided (AWS)"
      ^ here
    This one looks easy to fix. It seems that there is a value started
---
    with a quote, and the YAML parser is expecting to see the line ended
    with the same kind of quote. For instance:

        when: "ok" in result.stdout

    Could be written as:

       when: '"ok" in result.stdout'

    Or equivalently:

       when: "'ok' in result.stdout"

NO MORE HOSTS LEFT **********************************************************************************************************

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

[ibmmas/cli:7.11.1]mascli$

Adding ipi_platform: "{{ lookup('env', 'IPI_PLATFORM') }}" to /opt/app-root/lib64/python3.9/site-packages/ansible_collections/ibm/mas_devops/roles/ocp_deprovision/defaults/main.yml resolved the 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

No branches or pull requests

1 participant