ansible / awx-operator

An Ansible AWX operator for Kubernetes built with Operator SDK and Ansible. 🤖
https://www.github.com/ansible/awx
Apache License 2.0
1.26k stars 633 forks source link

Unable to Import Inventory File in AWX Operator #1926

Open j551n-ncloud opened 4 months ago

j551n-ncloud commented 4 months ago

Please confirm the following

Bug Summary

I am encountering an issue with importing an inventory file in the AWX Operator. The inventory file is in INI format, but it fails to parse correctly, leading to errors during the inventory import process. Specifically Children Groups

AWX version

2.19.1

Select the relevant components

Installation method

kubernetes

Modifications

no

Ansible version

AWX EE (24.6.1)

Operating system

Debian 12

Web browser

Firefox

Steps to reproduce

ini1 server_hw:

ini

[hw_servers]

admin01 client=group1 software=True homes=False backup=True automounts=True bondmaster="bond0" bondslaves="['eth0', 'eth1']" ib=True admin02 client=group1 software=True homes=False backup=True automounts=True bondmaster="bond0" bondslaves="['eth2', 'eth3']"

srv02 software=True homes=False backup=True automounts=True bondmaster="bond0" bondslaves="['eth0', 'eth1']" srv05 client=group1 bondmaster="bond0" bondslaves="['eth0','eth1']" backup=True software=False srv06 client=group1 bondmaster="bond0" bondslaves="['eth4','eth5']" ib=True automounts=True software=True homes=False

srv10 client=group1 backup=True software=False

srv17 bondslaves="['eth0', 'eth1']" bondmaster="bond0" srv18 bondslaves="['eth0', 'eth1']" bondmaster="bond0"

sm01 ib=True release="" bondmaster="bond0" bondslaves="['eth4', 'eth5']" client=group1

test01 client="" bondmaster="bond0" bondslaves="['eth2', 'eth3']" ib=True release="" automounts=True homes=False cluster=True test02 client="" bondmaster="bond0" bondslaves="['eth2', 'eth3']" ib=True release="" automounts=True homes=False cluster=True test03 client="" bondmaster="bond0" bondslaves="['eth2', 'eth3']" ib=True release="" automounts=True homes=False cluster=True test04 client="" bondmaster="bond0" bondslaves="['eth2', 'eth3']" ib=True release="" automounts=True homes=False cluster=True test05 client="" bondmaster="bond0" bondslaves="['eth2', 'eth3']" ib=True release="" automounts=True homes=False cluster=True test06 client="" bondmaster="bond0" bondslaves="['eth2', 'eth3']" ib=True release="" automounts=True homes=False cluster=True

build01 ib=False homes=True release="" client=group1 software=True backup=True

srv04 release="" backup=True ib=False bondmaster="bond0" bondslaves="['eth2','eth3']" client=group1

dragen release="" backup=False ib=False bondmaster="bond0" bondslaves="['eth6','eth7']" client=group1 automounts=True

gpu01 bondmaster="bond0" bondslaves="['eth8', 'eth9']" users="['users', 'group2']" automounts=False

[hw_servers:vars] software=False static_ip=True

ini 2 server_vm:

ini

[vm_servers]

vm100 client=group1 ib=False container=True

vm101 ib=False backup=True users="['user', 'guide']" client=group1 automounts=True

vm102 client=group1 ib=False container=True backup=True

vm103 client=group1 ib=False container=True backup=True

vm106 ib=False vm107 ib=False

vm108 client=group1 users="['user', 'otrs']" backup=True software=False

vm113 client=group1 users="['user', 'otrs']" mail="admin@domain.com"

vm114 ib=False backup=False

vm115 ib=False backup=False

vm116 ib=False backup=True

vm117 ib=False backup=True users="['user', 'guide']" client=group1 automounts=True vm136 ib=False backup=False users="['user', 'guide']" client=group1 automounts=True

vm118 ib=False backup=True client=group1

vm119 ib=False backup=True container=True client=group1

vm121 backup=True client=group1 software=True release="" dev_packages=True vm137 backup=True client=group1 software=True dev_packages=True

vm122 ib=False backup=True client=group1 software=False automounts=False users="['user', 'otp']"

vm123 ib=False backup=False client=group1 users="['user', 'otrs']" software=True

vm125 backup=True client=group1 users="['group']" automounts=True software=True

vm126 backup=True client=group1 vm145 backup=True client=group1

vm127 automounts=True homes=True nfsmounts="[]" skip_nfsmounts=True client=group1 backup=True users="['user', 'linker']"

vm129 homes=True client=group1 ib=False backup=True vm130 automounts=True homes=True client=group1 ib=False backup=False

vm138 ib=False backup=True client=group1 software=False automounts=False auth_keys="['key']"

vm140 homes=True backup=True

vm141 homes=True backup=False vm144 homes=True backup=False

vm142 vm143 vm112

vm128

vm146 backup=True client=group1 vm148 backup=True client=group1 vm149 backup=True client=group1

vm147 backup=True homes=True client=group1 vm151 backup=True homes=True client=group1

vm150 homes=True backup=True client=group1

otp-ws1 client=group1 backup=True software=True automounts=True users="['user', 'otp']" otp-ws2 client=group1 backup=True software=True automounts=True users="['user', 'otp']" otp-lb client=group1 backup=True users="['user', 'lb']"

dmz01 homes=True client=group1 backup=True users="['user', 'dmz']" dmz02 homes=True client=group1 backup=True users="['user', 'dmz']"

[vm_servers:vars] software=False skip_nfsmounts=True ib=False

[transfer_servers] vm104 client=group1 ib=False users="['group', 'transfer']" automounts=True

[transfer_servers:vars] software=False skip_nfsmounts=True ib=False

[docker] vm107 docker_user="user"

ini 3 server_all:

ini

[servers:children] hw_servers fileservers vm_servers transfer_servers

[servers:vars] homes=True

Expected results

Importet

Actual results

[WARNING]: Failed to parse /runner/project/02-servers-all 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. did not find expected The error appears to be in '/runner/project/02-servers-all': line 6, column 1, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: [servers:children] hw_servers ^ here File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/yaml.py", line 107, in parse raise AnsibleParserError(e) [WARNING]: Failed to parse /runner/project/02-servers-all with ini plugin: /runner/project/02-servers-all:6: Section [servers:children] includes undefined group: hw_servers File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/ini.py", line 137, in parse raise AnsibleParserError(e) [WARNING]: Unable to parse /runner/project/02-servers-all as an inventory source

Additional information

No response

djyasin commented 4 months ago

Hello @j551n-ncloud , this issue seems to be related to AWX Operator, so we have transferred it accordingly.