aoscx-ansible-collection
aoscx-ansible-collection copied to clipboard
Unable to parse inventory_hostname when an FQDN hostname is specified in inventory
It looks like the Aruba module is unable to parse inventory_hostname
when an FQDN hostname is specified. It only seems to work when an alias is specified in the inventory file. For example
This works
all:
hosts:
aoscx_1:
ansible_host: 10.200.4.110
This does not work
all:
hosts:
foo.example.com:
bar.example.com:
The error message I get is
[WARNING]: The "arubanetworks.aoscx.aoscx" connection plugin has an improperly configured remote target value, forcing
"inventory_hostname" templated value instead of the string
"msg": "Could not get PYAOSCX Session: HTTPSConnectionPool(host='inventory_hostname', port=443): Max retries exceeded with url: /rest/v10.04/login (Caused by NameResolutionError(\"<urllib3.connection.HTTPSConnection object at 0x7f62b437ba30>: Failed to resolve 'inventory_hostname' ([Errno -2] Name or service not known)\"))"
Ansible control machine packages
$ ansible --version
ansible [core 2.15.9]
config file = /home/johndoe/aoscx/ansible.cfg
configured module search path = ['/home/johndoe/env/lib/python3.9/site-packages']
ansible python module location = /home/johndoe/env/lib64/python3.9/site-packages/ansible
ansible collection location = /home/johndoe/.ansible/collections:/usr/share/ansible/collections
executable location = /home/johndoe/env/bin/ansible
python version = 3.9.18 (main, Jan 4 2024, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/home/johndoe/env/bin/python3)
jinja version = 3.1.3
libyaml = True
$ pip --version
pip 24.0 from /home/johndoe/env/lib64/python3.9/site-packages/pip (python 3.9)
$ ansible-galaxy collection list
# /home/johndoe/.ansible/collections/ansible_collections
Collection Version
----------------------------- -------
arubanetworks.aoscx 4.3.1
$ pip list
Package Version
------------------- --------
ansible 8.7.0
ansible-core 2.15.9
ansible-pylibssh 1.1.0
bcrypt 4.1.2
certifi 2024.2.2
cffi 1.16.0
charset-normalizer 3.3.2
cryptography 42.0.3
idna 3.6
importlib-resources 5.0.7
Jinja2 3.1.3
MarkupSafe 2.1.5
netaddr 1.2.1
packaging 23.2
paramiko 3.4.0
pip 24.0
pyaoscx 2.5.1
pycparser 2.21
PyNaCl 1.5.0
PyYAML 6.0.1
requests 2.31.0
requests-toolbelt 1.0.0
resolvelib 1.0.1
setuptools 53.0.0
urllib3 2.2.1
wheel 0.42.0