diff --git a/changelogs/fragments/lldp-use-get_bin_path-to-locate-the-lldpctl-executable.yaml b/changelogs/fragments/lldp-use-get_bin_path-to-locate-the-lldpctl-executable.yaml new file mode 100644 index 0000000000..4fefd3dd87 --- /dev/null +++ b/changelogs/fragments/lldp-use-get_bin_path-to-locate-the-lldpctl-executable.yaml @@ -0,0 +1,2 @@ +bugfixes: + - lldp - use ``get_bin_path`` to locate the ``lldpctl`` executable (https://github.com/ansible-collections/community.general/pull/1643). diff --git a/plugins/modules/net_tools/lldp.py b/plugins/modules/net_tools/lldp.py index 41853eb864..ae86db4088 100644 --- a/plugins/modules/net_tools/lldp.py +++ b/plugins/modules/net_tools/lldp.py @@ -41,7 +41,7 @@ from ansible.module_utils.basic import AnsibleModule def gather_lldp(module): - cmd = ['lldpctl', '-f', 'keyvalue'] + cmd = [module.get_bin_path('lldpctl'), '-f', 'keyvalue'] rc, output, err = module.run_command(cmd) if output: output_dict = {}