mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Fix fetching old style facts in junos_facts module (#42336)
* Fix fetching old style facts in junos_facts module Fixes #42298 * To fetch old style facts from junos device it requires login credentials in provider, hence while using connection=nectonf do not delete provider values as it might not be ignored * Add `ofacts` as one of the options in `gather_subset` * Minor update in documentation * Fix CI failure
This commit is contained in:
parent
62e7a65459
commit
31dd41e4c5
2 changed files with 31 additions and 21 deletions
|
@ -91,8 +91,11 @@ class ActionModule(_ActionModule):
|
|||
elif self._play_context.connection in ('netconf', 'network_cli'):
|
||||
provider = self._task.args.get('provider', {})
|
||||
if any(provider.values()):
|
||||
display.warning('provider is unnecessary when using %s and will be ignored' % self._play_context.connection)
|
||||
del self._task.args['provider']
|
||||
# for legacy reasons provider value is required for junos_facts(optional) and junos_package
|
||||
# modules as it uses junos_eznc library to connect to remote host
|
||||
if not (self._task.action == 'junos_facts' or self._task.action == 'junos_package'):
|
||||
display.warning('provider is unnecessary when using %s and will be ignored' % self._play_context.connection)
|
||||
del self._task.args['provider']
|
||||
|
||||
if (self._play_context.connection == 'network_cli' and self._task.action not in CLI_SUPPORTED_MODULES) or \
|
||||
(self._play_context.connection == 'netconf' and self._task.action == 'junos_netconf'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue