Skip to content

Conversation

@durera
Copy link
Contributor

@durera durera commented Nov 25, 2025

Description

Adds a minimum version check for the mas-devops python package, and fixes more bugs related to use of this collection with Ansible v12 runtime.

Testing failure (with a new minimum version of mas-devops that hasn't been released)

TASK [Verify minimum mas-devops version is 7.10.0] ***************************************************************************************************
fatal: [localhost]: FAILED! => changed=false 
  assertion: mas_devops_version[0] is version_compare(required_mas_devops_python_version, '>=')
  evaluated_to: false
  msg: The version of mas-devops python package installed is too old (minimum version is 7.10.0).

Testing success

TASK [Get installed version of mas-devops] ***********************************************************************************************************
ok: [localhost] => changed=false 
  ansible_facts:
    mas_devops_version:
    - 7.1.0

TASK [Verify minimum mas-devops is installed] ********************************************************************************************************
ok: [localhost] => changed=false 
  msg: All assertions passed

TASK [Verify minimum mas-devops version is 7.1.0] ****************************************************************************************************
ok: [localhost] => changed=false 
  msg: All assertions passed

Testing not installed (by changing the package name being looked for)

TASK [Get installed version of mas-devops] ***********************************************************************************************************
skipping: [localhost] => changed=false 
  skip_reason: Conditional result was False

TASK [Verify minimum mas-devops is installed] ********************************************************************************************************
fatal: [localhost]: FAILED! => changed=false 
  assertion: mas_devops_version is defined
  evaluated_to: false
  msg: The mas-devops python package is not installed.

length can not be used with NoneType objects

TASK [ibm.mas_devops.suite_app_install : Install application] ******************
[DEPRECATION WARNING]: Direct access to the `environment` attribute is deprecated. This feature will be removed from ansible-core version 2.23. Consider using `copy_with_new_env` or passing `overrides` to `template`.
[ERROR]: Task failed: AnsibleTemplatePluginRuntimeError: 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_install/tasks/main.yml:90:3

88 # 7. App installation
89 # -----------------------------------------------------------------------------
90 - name: Install application
     ^ column 3

<<< caused by >>>

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

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

⚠️ Notes for Reviewers

  • Ensure you have understood the PR guidelines in the Playbook before proceeding with a review.
  • Ensure all sections in the PR template are appropriately completed.

@durera durera changed the title [patch] Check for None before trying to determine length [patch] Add mas-devops minimum version check Nov 26, 2025
@durera durera changed the title [patch] Add mas-devops minimum version check [patch] Add mas-devops python package minimum version check Nov 26, 2025
@durera durera linked an issue Nov 26, 2025 that may be closed by this pull request
@durera durera marked this pull request as ready for review November 28, 2025 11:26
@durera durera requested a review from a team as a code owner November 28, 2025 11:26
@durera durera merged commit d6a8451 into master Nov 28, 2025
2 checks passed
@durera durera deleted the py312 branch November 28, 2025 11:26
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

Successfully merging this pull request may close these issues.

ibm/mas_devops/plugins/action/apply_subscription.py

2 participants