예제 #1
0
def main():
    """
    Main entry point for module execution

    :returns: ansible_facts
    """
    argument_spec = FactsArgs.argument_spec
    argument_spec.update(iosxr_argument_spec)

    module = AnsibleModule(
        argument_spec=argument_spec,
        supports_check_mode=True,
    )

    warnings = []

    ansible_facts = {}
    if module.params.get("available_network_resources"):
        ansible_facts["available_network_resources"] = sorted(
            FACT_RESOURCE_SUBSETS.keys(), )
    result = Facts(module).get_facts()
    additional_facts, additional_warnings = result
    ansible_facts.update(additional_facts)
    warnings.extend(additional_warnings)

    module.exit_json(ansible_facts=ansible_facts, warnings=warnings)
예제 #2
0
def main():
    """
    Main entry point for module execution

    :returns: ansible_facts
    """
    argument_spec = FactsArgs.argument_spec
    argument_spec.update(iosxr_argument_spec)

    module = AnsibleModule(argument_spec=argument_spec,
                           supports_check_mode=True)

    warnings = []
    if module.params["gather_subset"] == "!config":
        warnings.append(
            "default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards"
        )

    ansible_facts = {}
    if module.params.get("available_network_resources"):
        ansible_facts["available_network_resources"] = sorted(
            FACT_RESOURCE_SUBSETS.keys())
    result = Facts(module).get_facts()
    additional_facts, additional_warnings = result
    ansible_facts.update(additional_facts)
    warnings.extend(additional_warnings)

    module.exit_json(ansible_facts=ansible_facts, warnings=warnings)
예제 #3
0
 def __init__(self, module):
     super(Bgp_neighbor_address_family, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="bgp_neighbor_address_family",
         tmplt=Bgp_neighbor_address_familyTemplate(),
     )
     self.parsers = [
         "router",
         "aigp",
         "allowas_in",
         "as_override",
         "bestpath_origin_as_allow_invalid",
         "capability_orf_prefix",
         "default_originate",
         "long_lived_graceful_restart_capable",
         "long_lived_graceful_restart_stale_time",
         "maximum_prefix",
         "multipath",
         "next_hop_self",
         "next_hop_unchanged",
         "optimal_route_reflection_group_name",
         "origin_as",
         "remove_private_AS",
         "route_reflector_client",
         "send_community_ebgp",
         "send_community_gshut_ebgp",
         "send_extended_community_ebgp",
         "send_multicast_attributes",
         "soft_reconfiguration",
         "weight",
         "site_of_origin",
         "validation",
     ]
예제 #4
0
 def __init__(self, module):
     super(Ntp_global, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="ntp_global",
         tmplt=Ntp_globalTemplate(),
     )
     self.parsers = [
         "access_group.ipv4.peer",
         "access_group.ipv4.serve",
         "access_group.ipv4.serve_only",
         "access_group.ipv4.query_only",
         "access_group.ipv6.peer",
         "access_group.ipv6.serve",
         "access_group.ipv6.serve_only",
         "access_group.ipv6.query_only",
         "authenticate",
         "log_internal_sync",
         "broadcastdelay",
         "drift.aging_time",
         "drift.file",
         "ipv4.dscp",
         "ipv4.precedence",
         "ipv6.dscp",
         "ipv6.precedence",
         "max_associations",
         "master.stratum",
         "passive",
         "update_calendar",
         "source_interface",
     ]
 def __init__(self, module):
     super(Acl_interfaces, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="acl_interfaces",
         tmplt=Acl_interfacesTemplate(),
     )
예제 #6
0
 def __init__(self, module):
     super(Ospfv3, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="ospfv3",
         tmplt=Ospfv3Template(),
     )
예제 #7
0
 def __init__(self, module):
     super(Prefix_lists, self).__init__(
         empty_fact_val=[],
         facts_module=Facts(module),
         module=module,
         resource="prefix_lists",
         tmplt=Prefix_listsTemplate(),
     )
     self.parsers = ["prefix", "description", "prefix_list"]
예제 #8
0
 def __init__(self, module):
     super(Hostname, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="hostname",
         tmplt=HostnameTemplate(),
     )
     self.parsers = ["hostname"]
예제 #9
0
 def get_interfaces_facts(self):
     """ Get the 'facts' (the current configuration)
     :rtype: A dictionary
     :returns: The current configuration as a dictionary
     """
     facts, _warnings = Facts(self._module).get_facts(self.gather_subset, self.gather_network_resources)
     interfaces_facts = facts['ansible_network_resources'].get('interfaces')
     if not interfaces_facts:
         return []
     return interfaces_facts
예제 #10
0
    def get_lldp_global_facts(self):
        """ Get the 'facts' (the current configuration)

        :rtype: A dictionary
        :returns: The current configuration as a dictionary
        """
        facts, _warnings = Facts(self._module).get_facts(
            self.gather_subset, self.gather_network_resources)
        lldp_facts = facts['ansible_network_resources'].get('lldp_global')
        if not lldp_facts:
            return {}
        return lldp_facts
예제 #11
0
    def get_acls_facts(self, data=None):
        """ Get the 'facts' (the current configuration)

        :rtype: A dictionary
        :returns: The current configuration as a dictionary
        """
        facts, _warnings = Facts(self._module).get_facts(
            self.gather_subset, self.gather_network_resources, data=data)
        acls_facts = facts["ansible_network_resources"].get("acls")
        if not acls_facts:
            return []
        return acls_facts
    def get_lacp_facts(self):
        """ Get the 'facts' (the current configuration)

        :rtype: A dictionary
        :returns: The current configuration as a dictionary
        """
        facts, _warnings = Facts(self._module).get_facts(
            self.gather_subset, self.gather_network_resources)
        lacp_facts = facts["ansible_network_resources"].get("lacp")
        if not lacp_facts:
            return {}
        return lacp_facts
예제 #13
0
 def __init__(self, module):
     super(Bgp_address_family, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="bgp_address_family",
         tmplt=Bgp_address_familyTemplate(),
     )
     self.parsers = [
         "router",
         "address_family",
         "advertise_best_external",
         "additional_paths",
         "allocate_label",
         "as_path_loopcheck_out_disable",
         "bgp_attribute_download",
         "bgp_bestpath_origin_as_use",
         "bgp_bestpath_origin_as_allow",
         "bgp_client_to_client_reflection_cluster_id",
         "bgp_reflection_disable",
         "bgp_dampening",
         "bgp_label_delay",
         "bgp_import_delay",
         "bgp_origin_as_validation",
         "bgp_scan_time",
         "default_martian_check_disable",
         "distance",
         "dynamic_med",
         "maximum_paths_ibgp",
         "maximum_paths_ebgp",
         "maximum_paths_eibgp",
         "optimal_route_reflection",
         "nexthop",
         "permanent_network_route_policy",
         "retain_local_label",
         "update",
         "global_table_multicast",
         "segmented_multicast",
         "inter_as_install",
         "vrf_all_conf",
         "weight",
         "route_target_download",
         "label_mode",
         "mvpn_single_forwarder_selection_highest_ip_address",
         "mvpn_single_forwarder_selection_all",
         "table_policy",
     ]
 def __init__(self, module):
     super(Logging_global, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="logging_global",
         tmplt=Logging_globalTemplate(),
     )
     self.parsers = [
         "archive.device",
         "archive.frequency",
         "archive.severity",
         "archive.archive_size",
         "archive.archive_length",
         "archive.file_size",
         "buffered.size",
         "buffered.severity",
         "buffered.discriminator",
         "console.severity",
         "correlator.buffer_size",
         "events.threshold",
         "events.buffer_size",
         "events.display_location",
         "events.severity",
         "facility",
         "hostnameprefix",
         "format",
         "ipv4.dscp",
         "ipv6.dscp",
         "ipv4.precedence",
         "ipv6.precedence",
         "localfilesize",
         "suppress.duplicates",
         "suppress.apply_rule",
         "monitor.severity",
         "monitor.discriminator",
         "history.size",
         "history.severity",
         "trap.severity",
         "trap.state",
         "monitor.state",
         "history.state",
         "console.state",
     ]
예제 #15
0
 def __init__(self, module):
     super(Ospf_interfaces, self).__init__(
         empty_fact_val=[],
         facts_module=Facts(module),
         module=module,
         resource="ospf_interfaces",
         tmplt=Ospf_interfacesTemplate(),
     )
     self.parsers = [
         "authentication.message_digest",
         "authentication.null_auth",
         "authentication.message_digest.keychain",
         "authentication_key",
         "bfd.minimum_interval",
         "bfd.multiplier",
         "bfd.fast_detect.set",
         "bfd.fast_detect.disable",
         "bfd.fast_detect.strict_mode",
         "cost",
         "cost_fallback",
         "dead_interval",
         "demand_circuit",
         "flood_reduction",
         "hello_interval",
         "link_down.set",
         "link_down.disable",
         "message_digest_key",
         "mpls.set_ldp",
         "mpls.ldp_sync",
         "mpls.ldp_sync_disable",
         "mtu_ignore",
         "network",
         "packet_size",
         "passive",
         "prefix_suppression.disable",
         "prefix_suppression.secondary_address",
         "priority",
         "retransmit_interval",
         "security.ttl_hops",
         "security.ttl",
         "transmit_delay",
     ]
예제 #16
0
def main():
    """
    Main entry point for module execution

    :returns: ansible_facts
    """
    spec = FactsArgs.argument_spec
    spec.update(iosxr_argument_spec)

    module = AnsibleModule(argument_spec=spec, supports_check_mode=True)
    warnings = [
        "default value for `gather_subset` "
        "will be changed to `min` from `!config` v2.11 onwards"
    ]

    result = Facts(module).get_facts()

    ansible_facts, additional_warnings = result
    warnings.extend(additional_warnings)

    module.exit_json(ansible_facts=ansible_facts, warnings=warnings)
예제 #17
0
 def __init__(self, module):
     super(Snmp_server, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="snmp_server",
         tmplt=Snmp_serverTemplate(),
     )
     self.parsers = [
         "chassis_id",
         "correlator.buffer_size",
         "contact",
         "ifindex",
         "ipv4.dscp",
         "ipv6.dscp",
         "ipv4.precedence",
         "ipv6.precedence",
         "location",
         "logging_threshold_oid_processing",
         "logging_threshold_pdu_processing",
         "mib_bulkstat_max_procmem_size",
         "mroutemib_send_all_vrf",
         "oid_poll_stats",
         "overload_control",
         "packetsize",
         "queue_length",
         "throttle_time",
         "trap_source",
         "trap_timeout",
         "drop.report_IPv4",
         "drop.report_IPv6",
         "drop.unknown_user",
         "ifmib.internal_cache_max_duration",
         "ifmib.ipsubscriber",
         "ifmib.stats",
         "ifmib.ifalias_long",
         "inform.timeout",
         "inform.retries",
         "inform.pending",
         "notification_log_mib.size",
         "notification_log_mib.default",
         "notification_log_mib.disable",
         "notification_log_mib.GlobalSize",
         "trap.link_ietf",
         "trap.authentication_vrf_disable",
         "trap.throttle_time",
         "timeouts.threshold",
         "timeouts.pdu_stats",
         "timeouts.subagent",
         "timeouts.inQdrop",
         "timeouts.duplicate",
         "traps.addrpool.low",
         "traps.addrpool.high",
         "traps.bfd",
         "traps.bgp.cbgp2",
         "traps.bgp.updown",
         "traps.bulkstat_collection",
         "traps.bulkstat_transfer",
         "traps.bridgemib",
         "traps.copy_complete",
         "traps.cisco_entity_ext",
         "traps.config",
         "traps.diameter.peerdown",
         "traps.diameter.peerup",
         "traps.diameter.protocolerror",
         "traps.diameter.permanentfail",
         "traps.diameter.transientfail",
         "traps.entity",
         "traps.entity_redundancy.all",
         "traps.entity_redundancy.status",
         "traps.entity_redundancy.switchover",
         "traps.entity_state.operstatus",
         "traps.entity_state.switchover",
         "traps.flash.removal",
         "traps.flash.insertion",
         "traps.fru_ctrl",
         "traps.hsrp",
         "traps.ipsla",
         "traps.ipsec.start",
         "traps.ipsec.stop",
         "traps.isakmp.start",
         "traps.isakmp.stop",
         "traps.isis",
         "traps.l2tun.pseudowire_status",
         "traps.l2tun.sessions",
         "traps.l2tun.tunnel_up",
         "traps.l2tun.tunnel_down",
         "traps.l2vpn.all",
         "traps.l2vpn.cisco",
         "traps.l2vpn.vc_up",
         "traps.l2vpn.vc_down",
         "traps.msdp_peer_state_change",
         "traps.ospf.retransmit.virt_packets",
         "traps.ospf.retransmit.packets",
         "traps.ospf.lsa.lsa_originate",
         "traps.ospf.lsa.lsa_maxage",
         "traps.ospf.errors.bad_packet",
         "traps.ospf.errors.authentication_failure",
         "traps.ospf.errors.config_error",
         "traps.ospf.errors.virt_bad_packet",
         "traps.ospf.errors.virt_authentication_failure",
         "traps.ospf.errors.virt_config_error",
         "traps.ospf.state_change.if_state_change",
         "traps.ospf.state_change.neighbor_state_change",
         "traps.ospf.state_change.virtif_state_change",
         "traps.ospf.state_change.virtneighbor_state_change",
         "traps.ospfv3.errors.bad_packet",
         "traps.ospfv3.errors.authentication_failure",
         "traps.ospfv3.errors.config_error",
         "traps.ospfv3.errors.virt_config_error",
         "traps.ospfv3.errors.virt_bad_packet",
         "traps.ospfv3.state_change.neighbor_state_change",
         "traps.ospfv3.state_change.virtif_state_change",
         "traps.ospfv3.state_change.virtneighbor_state_change",
         "traps.ospfv3.state_change.restart_status_change",
         "traps.ospfv3.state_change.restart_helper_status_change",
         "traps.ospfv3.state_change.restart_virtual_helper_status_change",
         "traps.ospfv3.state_change.nssa_state_change",
         "traps.power",
         "traps.rf",
         "traps.pim.neighbor_change",
         "traps.pim.invalid_message_received",
         "traps.pim.rp_mapping_change",
         "traps.pim.interface_state_change",
         "traps.rsvp.lost_flow",
         "traps.rsvp.new_flow",
         "traps.rsvp.all",
         "traps.selective_vrf_download_role_change",
         "traps.sensor",
         "traps.vrrp_events",
         "traps.syslog",
         "traps.system",
         "traps.subscriber.session_agg_access_interface",
         "traps.subscriber.session_agg_node",
         "traps.vpls.all",
         "traps.vpls.full_clear",
         "traps.vpls.full_raise",
         "traps.vpls.status",
         "traps.snmp.linkup",
         "traps.snmp.linkdown",
         "traps.snmp.coldstart",
         "traps.snmp.warmstart",
         "traps.snmp.authentication",
     ]
예제 #18
0
 def __init__(self, module):
     super(Bgp_global, self).__init__(
         empty_fact_val={},
         facts_module=Facts(module),
         module=module,
         resource="bgp_global",
         tmplt=Bgp_globalTemplate(),
     )
     self.parsers = [
         "router",
         "bfd_multiplier",
         "bfd_minimum_interval",
         "bgp_auto_policy_soft_reset",
         "bgp_as_path_loopcheck",
         "bgp_cluster_id",
         "bgp_default_local_preference",
         "bgp_enforce_first_as_disable",
         "bgp_fast_external_fallover_disable",
         "bgp_install_diversion",
         "bgp_max_neighbors",
         "bgp_redistribute_internal",
         "bgp_router_id",
         "bgp_scan_time",
         "bgp_unsafe_ebgp_policy",
         "bgp_update_delay",
         "bgp_bestpath_aigp",
         "bgp_bestpath_as_path_ignore",
         "bgp_bestpath_as_path_multipath_relax",
         "bgp_bestpath_med_always",
         "bgp_bestpath_med_confed",
         "bgp_bestpath_med_missing_as_worst",
         "bgp_bestpath_compare_routerid",
         "bgp_bestpath_cost_community_ignore",
         "bgp_bestpath_origin_as_use",
         "bgp_bestpath_origin_as_allow",
         "bgp_confederation_identifier",
         "bgp_graceful_restart_set",
         "bgp_graceful_restart_graceful_reset",
         "bgp_graceful_restart_restart_time",
         "bgp_graceful_restart_purge_time",
         "bgp_graceful_restart_stalepath_time",
         "bgp_log_message",
         "bgp_log_neighbor_changes_detail",
         "bgp_log_neighbor_changes_disable",
         "bgp_multipath_as_path_ignore_onwards",
         "bgp_origin_as_validation_disable",
         "bgp_origin_as_validation_signal_ibgp",
         "bgp_origin_as_validation_time_off",
         "bgp_origin_as_validation_time",
         "bgp_default_information_originate",
         "bgp_default_metric",
         "bgp_graceful_maintenance",
         "ibgp_policy_out_enforce_modifications",
         "mpls_activate_interface",
         "mvpn",
         "nsr_set",
         "nsr_disable",
         "socket_receive_buffer_size",
         "socket_send_buffer_size",
         "update_in_error_handling_basic_ebgp_disable",
         "update_in_error_handling_basic_ibgp_disable",
         "update_in_error_handling_extended_ebgp",
         "update_in_error_handling_extended_ibgp",
         "update_out_logging",
         "update_limit",
         "rpki_route_value",
         "rd_auto",
         "timers_keepalive",
     ]