From 9612e61f87611970a82f9da6974ed7477259ab17 Mon Sep 17 00:00:00 2001 From: Renato Almeida de Oliveira Date: Fri, 4 Sep 2020 02:20:14 -0300 Subject: [PATCH] Set export on Config to verbose (#104) * Set export on Config to verbose SUMMARY In the configuration export session i think that using /export verbose is better than just /export, because with export only some configurations sections are going to be missed like BGP configuration, as proposed in https://github.com/ansible/ansible/pull/67868 ISSUE TYPE Bugfix Pull Request COMPONENT NAME routeros_facts.py ADDITIONAL INFORMATION extract of the output with /export verbose # software id = # # # /interface ethernet set [ find default-name=ether1 ] advertise=\ 10M-half,10M-full,100M-half,100M-full,1000M-full arp=enabled arp-timeout=\ auto auto-negotiation=yes cable-settings=default disable-running-check=\ yes disabled=no full-duplex=yes loop-protect=default \ loop-protect-disable-time=5m loop-protect-send-interval=5s mac-address=\ 50:00:00:02:00:00 mtu=1500 name=ether1 orig-mac-address=50:00:00:02:00:00 \ rx-flow-control=off speed=1Gbps tx-flow-control=off set [ find default-name=ether2 ] advertise=\ 10M-half,10M-full,100M-half,100M-full,1000M-full arp=enabled arp-timeout=\ auto auto-negotiation=yes cable-settings=default disable-running-check=\ yes disabled=no full-duplex=yes loop-protect=default \ loop-protect-disable-time=5m loop-protect-send-interval=5s mac-address=\ 50:00:00:02:00:01 mtu=1500 name=ether2 orig-mac-address=50:00:00:02:00:01 \ rx-flow-control=off speed=1Gbps tx-flow-control=off set [ find default-name=ether3 ] advertise=\ ..... ..... Extract of Output with only /export: # software id = # # # /interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik /ip dhcp-client add dhcp-options=hostname,clientid disabled=no interface=ether1 * Create 104_routeros_facts_export_verbose * Update changelogs/fragments/104_routeros_facts_export_verbose Co-authored-by: Felix Fontein * Rename export to export_verbose * Rename 104_routeros_facts_export_verbose to 104_routeros_facts_export_verbose.yml Co-authored-by: Felix Fontein (cherry picked from commit feb89c9eae046404addb8b71a771ff4a6a619b6f) --- changelogs/fragments/104_routeros_facts_export_verbose.yml | 2 ++ plugins/modules/network/routeros/routeros_facts.py | 2 +- .../routeros/fixtures/routeros_facts/{export => export_verbose} | 0 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/104_routeros_facts_export_verbose.yml rename tests/unit/plugins/modules/network/routeros/fixtures/routeros_facts/{export => export_verbose} (100%) diff --git a/changelogs/fragments/104_routeros_facts_export_verbose.yml b/changelogs/fragments/104_routeros_facts_export_verbose.yml new file mode 100644 index 00000000..2f80ea30 --- /dev/null +++ b/changelogs/fragments/104_routeros_facts_export_verbose.yml @@ -0,0 +1,2 @@ +minor_changes: + - routeros_facts - set configuration export on to verbose, for full configuration export (https://github.com/ansible-collections/community.network/pull/104). diff --git a/plugins/modules/network/routeros/routeros_facts.py b/plugins/modules/network/routeros/routeros_facts.py index df88aed4..3375c981 100644 --- a/plugins/modules/network/routeros/routeros_facts.py +++ b/plugins/modules/network/routeros/routeros_facts.py @@ -221,7 +221,7 @@ def to_megabytes(self, data): class Config(FactsBase): - COMMANDS = ['/export'] + COMMANDS = ['/export verbose'] def populate(self): super(Config, self).populate() diff --git a/tests/unit/plugins/modules/network/routeros/fixtures/routeros_facts/export b/tests/unit/plugins/modules/network/routeros/fixtures/routeros_facts/export_verbose similarity index 100% rename from tests/unit/plugins/modules/network/routeros/fixtures/routeros_facts/export rename to tests/unit/plugins/modules/network/routeros/fixtures/routeros_facts/export_verbose