fix: add inventory_hostname to host list#593
fix: add inventory_hostname to host list#593josephwhite13 wants to merge 1 commit intoJuniper:masterfrom
Conversation
|
This is still a problem and the above fix does work to correct the error. |
|
Hi @josephwhite13 , @ed-ud , Thanks |
Actually today we found that when you create a new python3.12 venv, and install Ansible and the juniper.device collection, the warning is still present but it also breaks juniper.device.pyez althogether unless you add the inventory_hostname to the list of vars as noted. Steps: Run a playbook that uses juniper.device.facts: Note that without the fix, it's trying to connect to the host "inventory_hostname" instead of the value of that variable. ... and the warning is fixed and the connection succeeds. Regarding the other warning - the syntax error causing "invalid escape *" is in "juniper/device/plugins/module_utils/juniper_junos_common.py" in this section: There is no need to try to escape the asterisk inside the comment. The other disturbing thing that I've come across while testing this over and over in a pristine environment is that the connections never ask for verification of any host's SSH public key. I've tried a dozen new hosts and it just blindly connects without any host key verification, despite explicity setting "host_key_auto_add=false" in ansible.cfg (which is the default). |
|
I encountered this problem today and was surprised to find this PR unmerged. This patch does solve the problem. |
|
@chidanandpujar - were you able to validate the fix as outlined by @ed-ud? Thanks! |
Hi @josephwhite13 @ed-ud Thanks |
|
Hi @ed-ud, Thanks |
Pass the hostlist variable on the command-line to choose which host in YOUR inventory will be tried. |
Hi @ed-ud , |
|
Can confirm this is still an issue today with Ansible 11.5.0 / Core 2.18.5 / juniper.device 1.0.8. |
|
I installed juniper.device 1.0.8... it doesn't appear to have the fix in ansible_collections/juniper/device/plugins/connection/pyez.py ... If you look at the relevant section in the file - it's missing the "inventory_hostname" in the vars list for the "host" option... ... so we get the exact same error as was originally reported stating that it couldn't connect to host called "inventory_hostname". |
|
Can confirm this is still an issue today with ansible-core 2.18.8 / juniper.device 1.0.8 or 1.0.9. |
|
Any updates on this issue?! |
|
@chidanandpujar please merge this, i am having the same issue with 3.12.12 ansible core 2.17 and juniper.device 1.0.9 I have to manually specify ansible_host=X.X.X.X to each host. |
It seems that the even though a default value is defined, it is now expected to be explicitly listed in the options.
Fixes the following warning message:
[WARNING]: The "ansible_collections.juniper.device.plugins.connection.pyez" connection plugin has an improperly configured remote target value, forcing "inventory_hostname" templated value instead of the string