This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2182747 - [RHOS-16.2.5] Unable to get equivalent information with ansible-inventory -i /usr/bin/tripleo-ansible-inventory
Summary: [RHOS-16.2.5] Unable to get equivalent information with ansible-inventory -i ...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-common
Version: 16.2 (Train)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: async
: 16.2 (Train on RHEL 8.4)
Assignee: Rabi Mishra
QA Contact: David Rosenfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-29 14:15 UTC by James Parker
Modified: 2025-01-08 11:30 UTC (History)
13 users (show)

Fixed In Version: openstack-tripleo-common-11.7.1-2.20240812095032.e189622.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-12-20 17:31:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 884574 0 None MERGED [train-only] Workaround inventory script plugin limitation 2023-11-02 17:35:49 UTC
Red Hat Issue Tracker OSP-23822 0 None None None 2023-03-29 14:17:13 UTC
Red Hat Issue Tracker OSP-33282 0 None None None 2024-12-20 17:30:35 UTC
Red Hat Issue Tracker   OSPRH-12610 0 None None None 2024-12-20 17:31:24 UTC
Red Hat Issue Tracker VALFRWK-817 0 None None None 2023-03-29 14:23:14 UTC

Description James Parker 2023-03-29 14:15:30 UTC
Description of problem: Issue started with lastest puddle (RHOS-16.2-RHEL-8-20230322.n.1).  Was originally able to gather deployment information by using ansible-inventory in conjuction with /usr/bin/tripleo-ansible-inventory but I am now seeing warning messages and less information including missing multiple api IP's and hostnames.

(undercloud) [stack@undercloud-0 ~]$ source ~/stackrc && ansible-inventory -i /usr/bin/tripleo-ansible-inventory --graph Controller 
[WARNING]:  * Failed to parse /usr/bin/tripleo-ansible-inventory with script plugin: You defined a group 'overcloud_excluded_overcloud' with bad data for the host list:  {'hosts': {}}
[WARNING]:  * Failed to parse /usr/bin/tripleo-ansible-inventory with yaml plugin: We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: Expecting value: line 1 column 1 (char 0)  Syntax Error while
loading YAML.   mapping values are not allowed in this context  The error appears to be in '/usr/bin/tripleo-ansible-inventory': line 77, column 20, but may be elsewhere in the file depending on the exact syntax problem.  The offending
line appears to be:   def _parse_config():                    ^ here
[WARNING]:  * Failed to parse /usr/bin/tripleo-ansible-inventory with ini plugin: /usr/bin/tripleo-ansible-inventory:22: Expected key=value host variable assignment, got: __future__
[WARNING]: Unable to parse /usr/bin/tripleo-ansible-inventory as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
@Controller:
  |--@overcloud_Controller:
  |  |--controller-0
(undercloud) [stack@undercloud-0 ~]$ source ~/stackrc && ansible-inventory -i /usr/bin/tripleo-ansible-inventory --host=controller-0
[WARNING]:  * Failed to parse /usr/bin/tripleo-ansible-inventory with script plugin: You defined a group 'overcloud_excluded_overcloud' with bad data for the host list:  {'hosts': {}}
[WARNING]:  * Failed to parse /usr/bin/tripleo-ansible-inventory with yaml plugin: We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: Expecting value: line 1 column 1 (char 0)  Syntax Error while
loading YAML.   mapping values are not allowed in this context  The error appears to be in '/usr/bin/tripleo-ansible-inventory': line 77, column 20, but may be elsewhere in the file depending on the exact syntax problem.  The offending
line appears to be:   def _parse_config():                    ^ here
[WARNING]:  * Failed to parse /usr/bin/tripleo-ansible-inventory with ini plugin: /usr/bin/tripleo-ansible-inventory:22: Expected key=value host variable assignment, got: __future__
[WARNING]: Unable to parse /usr/bin/tripleo-ansible-inventory as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
    "ansible_ssh_user": "tripleo-admin",
    "bootstrap_server_id": "35ef489d-6e89-453f-b9aa-58557e344a70",
    "container_cli": "podman",
    "ctlplane_vip": "192.168.24.42",
    "external_vip": "10.0.0.118",
    "internal_api_vip": "172.17.1.92",
    "redis_vip": "172.17.1.77",
    "serial": "1",
    "storage_mgmt_vip": "172.17.4.36",
    "storage_vip": "172.17.3.90",
    "tripleo_role_name": "Controller",
    "tripleo_role_networks": [
        "ctlplane",
        "external",
        "internal_api",
        "storage",
        "storage_mgmt",
        "tenant"
    ]
}


# Previous working version
(undercloud) [stack@undercloud ~]$ cat core_puddle_version 
RHOS-16.2-RHEL-8-20230301.n.1
[stack@undercloud ~]$ source ~/stackrc && ansible-inventory -i /usr/bin/tripleo-ansible-inventory --graph Controller 
@Controller:
  |--@overcloud_Controller:
  |  |--overcloud-controller-0
  |  |--overcloud-controller-1
  |  |--overcloud-controller-2
(undercloud) [stack@undercloud ~]$ source ~/stackrc && ansible-inventory -i /usr/bin/tripleo-ansible-inventory --graph Controller | sed -ne 's/^[ \t|]\+--\([a-z0-9\-]\+\)$/\1/p' | head -n 1
overcloud-controller-0
(undercloud) [stack@undercloud ~]$ source ~/stackrc && ansible-inventory -i /usr/bin/tripleo-ansible-inventory --host=overcloud-controller-0
{
    "ansible_host": "2620:dead:beef:5::b0e4",
    "ansible_ssh_user": "tripleo-admin",
    "bootstrap_server_id": "18e556fd-cbd7-4dd0-bcd1-d735ec59ebe7",
    "canonical_hostname": "overcloud-controller-0.localdomain",
    "container_cli": "podman",
    "ctlplane_hostname": "overcloud-controller-0.ctlplane.localdomain",
    "ctlplane_ip": "2620:dead:beef:5::b0e4",
    "ctlplane_vip": "2620:dead:beef:5::b150",
    "deploy_server_id": "18e556fd-cbd7-4dd0-bcd1-d735ec59ebe7",
    "external_hostname": "overcloud-controller-0.external.localdomain",
    "external_ip": "2620:52:0:13b8:5054:ff:fe3e:10",
    "external_vip": "2620:52:0:13b8:5054:ff:fe3e:1",
    "internal_api_hostname": "overcloud-controller-0.internalapi.localdomain",
    "internal_api_ip": "fd00:fd00:fd00:1000::2a8",
    "internal_api_vip": "fd00:fd00:fd00:1000::194",
    "redis_vip": "fd00:fd00:fd00:1000::67",
    "serial": "1",
    "storage_hostname": "overcloud-controller-0.storage.localdomain",
    "storage_ip": "fd00:fd00:fd00:2000::389",
    "storage_mgmt_hostname": "overcloud-controller-0.storagemgmt.localdomain",
    "storage_mgmt_ip": "fd00:fd00:fd00:3000::c3",
    "storage_mgmt_vip": "fd00:fd00:fd00:3000::250",
    "storage_vip": "fd00:fd00:fd00:2000::386",
    "tenant_hostname": "overcloud-controller-0.tenant.localdomain",
    "tenant_ip": "172.120.2.138",
    "tripleo_role_name": "Controller",
    "tripleo_role_networks": [
        "ctlplane",
        "external",
        "internal_api",
        "storage",
        "storage_mgmt",
        "tenant"
    ]
}


Version-Release number of selected component (if applicable):
RHOS-16.2-RHEL-8-20230322.n.1

How reproducible:
100%

Steps to Reproduce:
1. Deploy an environment with RHOS-16.2-RHEL-8-20230322.n.1 and attempt to gather plan information with source ~/stackrc && ansible-inventory -i /usr/bin/tripleo-ansible-inventory --graph Controller 
2.
3.

Actual results:
Inventory is not parsed and instead uses implicit local host information about inventory

Expected results:
Full inventory details are available


Additional info:


Note You need to log in before you can comment on or make changes to this bug.