Skip to content

suite_app_config: manage role fails when MAS_APPWS_COMPONENTS is unset or empty due to NoneType length check #2175

@Mahendran-R-000

Description

@Mahendran-R-000

Collection version

latest

Environment information

quay.io/ibmmas/cli:19.4.0

What happened?

The latest Ansible run with ibm.mas_devops is failing during Manage configuration with:

The filter plugin 'ansible.builtin.length' failed: object of type 'NoneType' has no len()

This happens in suite_app_config for Manage, where is_full_manage is evaluated. The current failure suggests that mas_appws_components is being resolved as None, and the expression using | length does not handle that case safely.

When MAS_APPWS_COMPONENTS is set to an empty string, the playbook fails with the NoneType length error during Manage pre-configuration. The failure points to the when: is_full_manage condition in tasks/manage/pre-config/main.yml, and the variable logic in vars/manage.yml appears to depend on mas_appws_components not being None.

As a workaround passing it dorectly via -e works as expected

ansible-playbook mas_add_manage.yml -i inventory \
  -e MAS_APPWS_COMPONENTS="" 

The issue may be related to a newer Ansible behavior where is defined does not protect against None in the same way as before

Relevant log output

[ERROR]: Task failed: The filter plugin 'ansible.builtin.length' failed: object of type 'NoneType' has no len()

Task failed.
Origin: /opt/app-root/lib64/python3.12/site-packages/ansible_collections/ibm/mas_devops/roles/suite_app_config/tasks/manage/pre-config/main.yml:7:3

5
6 # Manage pre-configuration: pod templates
7 - name: "Run Manage specific pre-configuration: Pod Templates"
    ^ column 3

<<< caused by >>>

The filter plugin 'ansible.builtin.length' failed: object of type 'NoneType' has no len()
Origin: /opt/app-root/lib64/python3.12/site-packages/ansible_collections/ibm/mas_devops/roles/suite_app_config/tasks/manage/pre-config/main.yml:9:9

7 - name: "Run Manage specific pre-configuration: Pod Templates"
8   include_tasks: "tasks/manage/pre-config/setup-pod-templates.yml"
9   when: is_full_manage
          ^ column 9

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Task failed: The filter plugin 'ansible.builtin.length' failed: object of type 'NoneType' has no len()"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug ReportSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions