-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add inventory_hostname to host list #593
base: master
Are you sure you want to change the base?
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 ,
|
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