Skip to content

infra.aap_configuration.controller_inventories doesn't delete disabled inventories #1139

@mdinwoodie

Description

@mdinwoodie

Summary

When ran against a disabled inventory, the infra.aap_configuration.controller_inventories module runs successfully but doesn't delete the inventory.

Issue Type

  • Bug Report

Ansible, Collection, Controller details

ansible --version
ansible [core 2.16.14]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.11 (main, Feb 10 2025, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] (/usr/bin/python3.11)
  jinja version = 3.1.6
  libyaml = True

ansible-galaxy collection list
# /usr/share/ansible/collections/ansible_collections
Collection               Version
------------------------ ------------
amazon.aws               9.4.0
ansible.controller       4.6.11
ansible.hub              1.0.0
ansible.netcommon        8.0.0
ansible.platform         2.5.20250326
ansible.posix            2.0.0
ansible.utils            6.0.0
community.aws            9.2.0
community.general        11.0.0
community.hashi_vault    6.2.0
infra.aap_configuration  3.1.0
infra.quay_configuration 2.5.2
kubernetes.core          5.2.0
openstack.cloud          2.4.1
redhat.rhel_system_roles 1.95.7
redhat.runtimes_common   1.2.2
redhat.sso               2.0.0
servicenow.itsm          2.8.0

Controller version
4.6.16
  • ansible installation method: EE

OS / ENVIRONMENT

AAP 2.5, Controller 4.6.16

Desired Behavior

The inventory gets deleted.

Actual Behavior

The inventory is not deleted, despite the task running successfully:

{
    "started": 1,
    "finished": 1,
    "stdout": "",
    "stderr": "",
    "stdout_lines": [],
    "stderr_lines": [],
    "ansible_job_id": "j487021076787.1820",
    "results_file": "/runner/.ansible_async/j487021076787.1820",
    "changed": true,
    "id": 67,
    "invocation": {
      "module_args": {
        "name": "CMDB-ocp-kk04e2o1-uzndv",
        "organization": "Services",
        "instance_groups": [
          "servicecatalog"
        ],
        "state": "absent",
        "controller_host": "http://aap-instance.aap-instance.svc",
        "controller_username": "admin",
        "controller_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
        "validate_certs": null,
        "request_timeout": null,
        "controller_oauthtoken": null,
        "controller_config_file": null,
        "new_name": null,
        "copy_from": null,
        "description": null,
        "variables": null,
        "kind": null,
        "host_filter": null,
        "prevent_instance_group_fallback": null,
        "input_inventories": null
      }
    },
    "_ansible_no_log": false,
    "attempts": 2,
    "__inventories_job_async_result_item": {
      "failed": 0,
      "started": 1,
      "finished": 0,
      "ansible_job_id": "j487021076787.1820",
      "results_file": "/runner/.ansible_async/j487021076787.1820",
      "changed": false,
      "__controller_inventory_item": {
        "name": "CMDB-ocp-kk04e2o1-uzndv",
        "state": "absent",
        "description": "",
        "organization": "Services",
        "instance_groups": [
          "servicecatalog"
        ]
      },
      "ansible_loop_var": "__controller_inventory_item"
    },
    "ansible_loop_var": "__inventories_job_async_result_item",
    "_ansible_item_label": "Remove Controller inventory CMDB-ocp-kk04e2o1-uzndv | Wait for finish the inventories deletion"
  }

STEPS TO REPRODUCE

  1. Run the following playbook against an AAP 2.5 environment, specifying a disabled inventory:
controller_inventories:
- name: $INVENTORY_NAME
   state: absent
   description: ""
   organization: "$ORG"
   instance_groups:
     - "$INSTANCE_GROUP"
  1. Check the inventory in the AAP UI to see if it was deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions