mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* lldp - use get_bin_path to locate the lldpctl executable
* This prevents failed executions
FAILED! => {"changed": false, "cmd": "lldpctl -f keyvalue",
"msg": "[Errno 2] No such file or directory", "rc": 2}
on hosts (servers and switches) with lldpd installed and running.
* Update changelogs/fragments/lldp-use-get_bin_path-to-locate-the-lldpctl-executable.yaml
Specify pull request id and minor formatting tweaks
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/lldp-use-get_bin_path-to-locate-the-lldpctl-executable.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1dd5e71cff
)
Co-authored-by: José Pedro Oliveira <jose.p.oliveira.oss@gmail.com>
This commit is contained in:
parent
5ece46c56e
commit
90c278ad87
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- lldp - use ``get_bin_path`` to locate the ``lldpctl`` executable (https://github.com/ansible-collections/community.general/pull/1643).
|
|
@ -41,7 +41,7 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
||||||
def gather_lldp(module):
|
def gather_lldp(module):
|
||||||
cmd = ['lldpctl', '-f', 'keyvalue']
|
cmd = [module.get_bin_path('lldpctl'), '-f', 'keyvalue']
|
||||||
rc, output, err = module.run_command(cmd)
|
rc, output, err = module.run_command(cmd)
|
||||||
if output:
|
if output:
|
||||||
output_dict = {}
|
output_dict = {}
|
||||||
|
|
Loading…
Reference in a new issue