From 09e9bf5fc3a837d0ac5cb45811deb26c9f1e3bbd Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Tue, 31 May 2022 12:12:53 -0400 Subject: [PATCH] Fix inventory_hostname being returned when looking for the remote hostname (#431) --- changelogs/fragments/remote_addr.yaml | 4 ++++ docs/ansible.netcommon.httpapi_connection.rst | 1 + docs/ansible.netcommon.libssh_connection.rst | 1 + docs/ansible.netcommon.napalm_connection.rst | 1 + docs/ansible.netcommon.netconf_connection.rst | 1 + docs/ansible.netcommon.network_cli_connection.rst | 1 + plugins/connection/httpapi.py | 1 + plugins/connection/libssh.py | 1 + plugins/connection/napalm.py | 1 + plugins/connection/netconf.py | 1 + plugins/connection/network_cli.py | 1 + 11 files changed, 14 insertions(+) create mode 100644 changelogs/fragments/remote_addr.yaml diff --git a/changelogs/fragments/remote_addr.yaml b/changelogs/fragments/remote_addr.yaml new file mode 100644 index 000000000..f9db45484 --- /dev/null +++ b/changelogs/fragments/remote_addr.yaml @@ -0,0 +1,4 @@ +--- +bugfixes: + - libssh - Fix for improperly set hostname in url + - httpapi - Fix for improperly set hostname in connect diff --git a/docs/ansible.netcommon.httpapi_connection.rst b/docs/ansible.netcommon.httpapi_connection.rst index 4ea3d22da..cbe8c9e81 100644 --- a/docs/ansible.netcommon.httpapi_connection.rst +++ b/docs/ansible.netcommon.httpapi_connection.rst @@ -94,6 +94,7 @@ Parameters Default:
"inventory_hostname"
+
var: inventory_hostname
var: ansible_host
diff --git a/docs/ansible.netcommon.libssh_connection.rst b/docs/ansible.netcommon.libssh_connection.rst index c8a4b6cf2..781a72434 100644 --- a/docs/ansible.netcommon.libssh_connection.rst +++ b/docs/ansible.netcommon.libssh_connection.rst @@ -190,6 +190,7 @@ Parameters Default:
"inventory_hostname"
+
var: inventory_hostname
var: ansible_host
var: ansible_ssh_host
var: ansible_libssh_host
diff --git a/docs/ansible.netcommon.napalm_connection.rst b/docs/ansible.netcommon.napalm_connection.rst index 6925594ee..dae72e9e8 100644 --- a/docs/ansible.netcommon.napalm_connection.rst +++ b/docs/ansible.netcommon.napalm_connection.rst @@ -60,6 +60,7 @@ Parameters Default:
"inventory_hostname"
+
var: inventory_hostname
var: ansible_host
diff --git a/docs/ansible.netcommon.netconf_connection.rst b/docs/ansible.netcommon.netconf_connection.rst index 94ee588da..f80f4ddaa 100644 --- a/docs/ansible.netcommon.netconf_connection.rst +++ b/docs/ansible.netcommon.netconf_connection.rst @@ -54,6 +54,7 @@ Parameters Default:
"inventory_hostname"
+
var: inventory_hostname
var: ansible_host
diff --git a/docs/ansible.netcommon.network_cli_connection.rst b/docs/ansible.netcommon.network_cli_connection.rst index e6692d8fc..4fe9286d6 100644 --- a/docs/ansible.netcommon.network_cli_connection.rst +++ b/docs/ansible.netcommon.network_cli_connection.rst @@ -124,6 +124,7 @@ Parameters Default:
"inventory_hostname"
+
var: inventory_hostname
var: ansible_host
diff --git a/plugins/connection/httpapi.py b/plugins/connection/httpapi.py index 829669990..9863343e1 100644 --- a/plugins/connection/httpapi.py +++ b/plugins/connection/httpapi.py @@ -23,6 +23,7 @@ to. default: inventory_hostname vars: + - name: inventory_hostname - name: ansible_host port: type: int diff --git a/plugins/connection/libssh.py b/plugins/connection/libssh.py index 813ccc953..c9f67223c 100644 --- a/plugins/connection/libssh.py +++ b/plugins/connection/libssh.py @@ -20,6 +20,7 @@ - Address of the remote target default: inventory_hostname vars: + - name: inventory_hostname - name: ansible_host - name: ansible_ssh_host - name: ansible_libssh_host diff --git a/plugins/connection/napalm.py b/plugins/connection/napalm.py index 4e4d96bf0..d70b9abc3 100644 --- a/plugins/connection/napalm.py +++ b/plugins/connection/napalm.py @@ -31,6 +31,7 @@ to. default: inventory_hostname vars: + - name: inventory_hostname - name: ansible_host port: type: int diff --git a/plugins/connection/netconf.py b/plugins/connection/netconf.py index f55b978b0..2e6eed4cf 100644 --- a/plugins/connection/netconf.py +++ b/plugins/connection/netconf.py @@ -29,6 +29,7 @@ to. default: inventory_hostname vars: + - name: inventory_hostname - name: ansible_host port: type: int diff --git a/plugins/connection/network_cli.py b/plugins/connection/network_cli.py index c41be99bb..854628493 100644 --- a/plugins/connection/network_cli.py +++ b/plugins/connection/network_cli.py @@ -27,6 +27,7 @@ to. default: inventory_hostname vars: + - name: inventory_hostname - name: ansible_host port: type: int