diff --git a/playbooks/tests/test_feature_templates.yml b/playbooks/tests/test_feature_templates.yml index ffce744..a35ae63 100644 --- a/playbooks/tests/test_feature_templates.yml +++ b/playbooks/tests/test_feature_templates.yml @@ -40,192 +40,250 @@ loop_var: template label: "template: {{ template.templateName }}" - - name: Create Comprehensive AAA Template with TACACS+ and RADIUS - cisco.catalystwan.feature_templates: - state: present - template_name: "ComprehensiveAAATemplate" - template_description: "AAA Template with both TACACS+ and RADIUS servers" - device_models: - - vmanage - cisco_aaa: - user: - - name: "local_admin" - password: "admin_password" - privilege: "15" - tacacs: - - group_name: "TACACSGroup1" - vpn: "0" - source_interface: "GigabitEthernet0/1" - server: - - address: "192.168.2.10" - port: "49" - timeout: "5" - key: "tacacs_key" - radius: - - group_name: "RADIUSGroup1" - vpn: "0" - source_interface: "GigabitEthernet0/0" - server: - - address: "192.168.1.10" - auth_port: "1812" - acct_port: "1813" - timeout: "5" - retransmit: "3" - key: "radius_key" - secret_key: "secret" - server_auth_order: - - "local" - - "RADIUSGroup1" - - "TACACSGroup1" - authentication_group: true - accounting_group: true - domain_stripping: 'yes' - manager_credentials: - <<: *manager_authentication + # vedge-C8000V templates - - name: Create Cisco Banner Feature Template - cisco.catalystwan.feature_templates: - state: present - template_name: "CiscoBannerConfigTemplate" - template_description: "Banner configuration for login and MOTD" - device_models: - - "vedge-C8000V" - cisco_banner: - login_banner: | - **************************************************************** - * Unauthorized access to this device is prohibited. * - * You must have explicit permission to access or configure this * - * device. All activities performed on this device are logged and * - * violations of this policy may result in disciplinary action, * - * and may be reported to law enforcement. There is no right to * - * privacy on this device. Use of this system constitutes consent * - * to monitoring for these purposes. * - **************************************************************** - motd_banner: | - **************************************************************** - * Welcome to Company XYZ Network! * - * All connections are monitored and recorded for audit purposes. * - * Disconnect IMMEDIATELY if you are not an authorized user! * - **************************************************************** - manager_credentials: - <<: *manager_authentication + # - name: "Create Comprehensive AAA Template with TACACS+ and RADIUS" + # cisco.catalystwan.feature_templates: + # state: present + # template_name: "ComprehensiveAAATemplate" + # template_description: "AAA Template with both TACACS+ and RADIUS servers" + # debug: true + # device_models: + # - vedge-C8000V + # cisco_aaa: + # user: + # - name: "local_admin" + # password: "admin_password" + # secret: "admin_secret" + # privilege: "15" + # pubkey_chain: + # - key_string: "AAAAB3NzaC1yc2EAAAADAQABAAABAQC3myRj5L6ZFLdRnOEZdUd+4Qq0XPLW9RfO6qD7DJ2t4ZzLh6Oz+IUJg8d8bJDfxO9zGKs5uUQ9f2H5yTGX5G8Z5kKp8QDp1MkDVqwGJ4UM7JqH8s8kD7xcl8SyPc5TjzK4s4W+8LPNOPXmIKtHh1Qlvkp5N7w3M/Rm5ZVX5/3+Hk8Ib5syigQQd/5u5xJj9k3i2x3m3LZ7v5e7YlCpRdCQGf6ZCwvbVQHdJp5nlU0HxJbqjOTL4IcDj09G3Dq2C5JnohKJb7E7HVCUl7F5vYpC/4iNjges65GgdzaFJsT9qA8CgxyF+7J3PpLk5qPAQDT5OjArJj4x9Bw3j3lZdH example@example.com" + # key_type: "ssh-rsa" + # authentication_group: true + # accounting_group: true + # radius: + # - group_name: "radius_group1" + # vpn: "1" + # source_interface: "GigabitEthernet0/0" + # server: + # - address: "192.0.2.1" + # auth_port: 1812 + # acct_port: 1813 + # timeout: 5 + # retransmit: 3 + # key: "secure_radius_server_key" + # secret_key: "radius_secret" + # key_enum: "key_enum_value" + # key_type: "key_type_value" + # domain_stripping: "right-to-left" + # port: 1234 + # authentication_type: any + # server_auth_order: "local radius_group1 tacacs_group1" + # server_key_password: "secure_server_key_password" + # cts_authorization_list: "example_element" + # radius_trustsec_group: "radius_group1" + # radius_client: + # - ip: 2.2.2.2 + # vpn: + # - name: example_radius_client + # server_key: secure_radius_client_key + # accounting_rules: + # - rule_id: 0 + # method: network + # level: "1" + # group: "radius_group1,tacacs_group1" + # start_stop: false + # authorization_console: true + # authorization_config_commands: true + # authorization_rules: + # - rule_id: 111 + # method: commands + # group: "radius_group1,tacacs_group1" + # authenticated: true + # tacacs: + # - group_name: "tacacs_group1" + # vpn: 2 + # source_interface: "GigabitEthernet0/1" + # server: + # - address: "192.0.2.2" + # port: 49 + # timeout: 10 + # key: "tacacs_key" + # secret_key: "tacacs_secret" + # key_enum: "key_enum_value" + # manager_credentials: + # <<: *manager_authentication - - name: Create Cisco BFD Feature Template - cisco.catalystwan.feature_templates: - state: present - template_name: "CiscoBFDFeatureTemplate" - template_description: "Comprehensive BFD configuration" - device_models: - - "vedge-C8000V" - cisco_bfd: - multiplier: "3" - poll_interval: "500" - default_dscp: "46" - color: - - color: "mpls" - hello_interval: "50" - multiplier: "3" - pmtu_discovery: "yes" - dscp: "48" - - color: "biz-internet" - hello_interval: "100" - multiplier: "4" - pmtu_discovery: "no" - dscp: "46" - - color: "private1" - hello_interval: "150" - multiplier: "5" - pmtu_discovery: "yes" - dscp: "44" - manager_credentials: - <<: *manager_authentication + # - name: Create Cisco Banner Feature Template + # cisco.catalystwan.feature_templates: + # state: present + # template_name: "CiscoBannerConfigTemplate" + # template_description: "Banner configuration for login and MOTD" + # debug: true + # device_models: + # - "vedge-C8000V" + # cisco_banner: + # login_banner: | + # **************************************************************** + # * Unauthorized access to this device is prohibited. * + # * You must have explicit permission to access or configure this * + # * device. All activities performed on this device are logged and * + # * violations of this policy may result in disciplinary action, * + # * and may be reported to law enforcement. There is no right to * + # * privacy on this device. Use of this system constitutes consent * + # * to monitoring for these purposes. * + # **************************************************************** + # motd_banner: | + # **************************************************************** + # * Welcome to Company XYZ Network! * + # * All connections are monitored and recorded for audit purposes. * + # * Disconnect IMMEDIATELY if you are not an authorized user! * + # **************************************************************** + # manager_credentials: + # <<: *manager_authentication - - name: Configure Cisco Logging Feature Template - cisco.catalystwan.feature_templates: - state: present - template_name: "CiscoLoggingFeatureTemplate" - template_description: "Comprehensive Logging Configuration" - device_models: - - "vedge-C8000V" - cisco_logging: - enable: "yes" - size: "10240" - rotate: "5" - tls_profile: - - profile: "StrictTLSProfile" - version: "TLSv1.2" - auth_type: "Mutual" - ciphersuite_list: - - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - server: - - name: "LogServer1" - vpn: "10" - source_interface: "GigabitEthernet0/0/0" - priority: "information" - enable_tls: "yes" - custom_profile: "yes" - profile: "StrictTLSProfile" - ipv6_server: - - name: "LogServerIPv6_1" - vpn: "10" - source_interface: "GigabitEthernet0/0/0" - priority: "error" - enable_tls: "yes" - custom_profile: "yes" - profile: "StrictTLSProfile" - manager_credentials: - <<: *manager_authentication + # - name: Create Cisco BFD Feature Template + # cisco.catalystwan.feature_templates: + # state: present + # template_name: "CiscoBFDFeatureTemplate" + # template_description: "Comprehensive BFD configuration" + # debug: true + # device_models: + # - "vedge-C8000V" + # cisco_bfd: + # multiplier: "3" + # poll_interval: "500" + # default_dscp: "46" + # color: + # - color: "mpls" + # hello_interval: "200" + # multiplier: "4" + # pmtu_discovery: true + # dscp: "46" + # - color: "biz-internet" + # hello_interval: "300" + # multiplier: "5" + # pmtu_discovery: false + # dscp: "34" + # - color: "private1" + # hello_interval: "250" + # multiplier: "3" + # pmtu_discovery: true + # dscp: "26" + # - color: "custom3" + # hello_interval: "350" + # multiplier: "6" + # pmtu_discovery: true + # dscp: "18" + # manager_credentials: + # <<: *manager_authentication - - name: Configure Cisco NTP Feature Template - cisco.catalystwan.feature_templates: - state: present - template_name: "CiscoNTPFeatureTemplate" - template_description: "Comprehensive NTP Configuration" - device_models: - - "vmanage" - cisco_ntp: - server: - - name: "0.pool.ntp.org" - key: "10" - vpn: "1" - version: "4" - source_interface: "GigabitEthernet0/0/0" - prefer: "yes" - - name: "1.pool.ntp.org" - key: "20" - vpn: "1" - version: "4" - source_interface: "GigabitEthernet0/0/1" - authentication: - - number: "10" - md5: "44b9d6ee8faafed3" - - number: "20" - md5: "f7a1a7e81e4567d9" - trusted: - - "10" - - "20" - enable: "yes" - stratum: "2" - source: "Loopback0" - manager_credentials: - <<: *manager_authentication + # - name: Configure Cisco Logging Feature Template + # cisco.catalystwan.feature_templates: + # state: present + # template_name: "CiscoLoggingFeatureTemplate" + # template_description: "Comprehensive Logging Configuration" + # debug: true + # device_models: + # - "vedge-C8000V" + # cisco_logging: + # enable: true + # size: "20" + # rotate: "5" + # tls_profile: + # - profile: "default_tls_profile" + # version: "TLSv1.2" + # auth_type: "Server" + # ciphersuite_list: + # - "ECDHE-ECDSA-AES256-GCM-SHA384" + # - "ECDHE-RSA-AES256-GCM-SHA384" + # - profile: "secure_tls_profile" + # version: "TLSv1.2" + # auth_type: "Mutual" + # ciphersuite_list: + # - "ECDHE-ECDSA-CHACHA20-POLY1305" + # - "ECDHE-RSA-CHACHA20-POLY1305" + # server: + # - name: "1.1.1.1" + # vpn: "10" + # source_interface: "GigabitEthernet0/0" + # priority: "debugging" + # enable_tls: true + # custom_profile: true + # profile: "default_tls_profile" + # - name: "log_server_2" + # vpn: "20" + # source_interface: "GigabitEthernet0/1" + # priority: "error" + # enable_tls: false + # ipv6_server: + # - name: "ipv6_log_server_1" + # vpn: "10" + # source_interface: "GigabitEthernet0/2" + # priority: "critical" + # enable_tls: true + # custom_profile: true + # profile: "secure_tls_profile" + # - name: "ipv6_log_server_2" + # vpn: "30" + # source_interface: "GigabitEthernet0/3" + # priority: "emergency" + # enable_tls: false + # manager_credentials: + # <<: *manager_authentication + + # - name: Configure Cisco NTP Feature Template + # cisco.catalystwan.feature_templates: + # state: present + # template_name: "CiscoNTPFeatureTemplate" + # template_description: "Comprehensive NTP Configuration" + # debug: true + # device_models: + # - "vedge-C8000V" + # cisco_ntp: + # server: + # - name: "0.pool.ntp.org" + # key: "1" + # vpn: "10" + # version: "4" + # source_interface: "GigabitEthernet0/0" + # prefer: true + # - name: "1.pool.ntp.org" + # key: "2" + # vpn: "20" + # version: "4" + # source_interface: "GigabitEthernet0/1" + # prefer: false + # authentication: + # - number: 1 + # md5: "md5key1" + # - number: 2 + # md5: "md5key2" + # trusted: + # - "1" + # - "2" + # enable: true + # stratum: "2" + # source: "Loopback0" + # manager_credentials: + # <<: *manager_authentication - name: Configure Cisco OMP Feature Template cisco.catalystwan.feature_templates: state: present template_name: "CiscoOMPFeatureTemplate" template_description: "Comprehensive OMP Configuration" + debug: true device_models: - - "vmanage" + - "vedge-C8000V" cisco_omp: - graceful_restart: "enabled" - overlay_as: "65530" - send_path_limit: "5" - ecmp_limit: "2" - shutdown: "enabled" # TODO - omp_admin_distance_ipv4: "130" - omp_admin_distance_ipv6: "130" + graceful_restart: true + overlay_as: "65000" + send_path_limit: "10" + ecmp_limit: "8" + shutdown: false + omp_admin_distance_ipv4: "110" + omp_admin_distance_ipv6: "115" advertisement_interval: "30" graceful_restart_timer: "120" eor_timer: "300" @@ -234,17 +292,190 @@ - protocol: "bgp" route: "external" - protocol: "ospf" + - protocol: "connected" - protocol: "static" + - protocol: "eigrp" + - protocol: "lisp" ipv6_advertise: - protocol: "bgp" - protocol: "ospf" - protocol: "connected" - ignore_region_path_length: "true" + - protocol: "static" + ignore_region_path_length: true transport_gateway: "prefer" site_types: - "type-1" - "type-2" + - "cloud" - "branch" - auto_translate: "enabled" + - "spoke" + auto_translate: true manager_credentials: <<: *manager_authentication + + + - name: Configure Cisco OSPF Feature Template + cisco.catalystwan.feature_templates: + state: present + template_name: "CiscoOSPFeatureTemplate" + template_description: "Comprehensive OSPF Configuration" + device_models: + - "vedge-C8000V" + cisco_ospf: + router_id: "1.1.1.1" + reference_bandwidth: "10000" + rfc1583: false + originate: true + always: true + metric: "10" + metric_type: "type1" + external: "20" + inter_area: "30" + intra_area: "40" + delay: "5" + initial_hold: "10" + max_hold: "40" + redistribute: + - protocol: "static" + route_policy: "static_policy" + dia: true + - protocol: "bgp" + route_policy: "bgp_to_ospf_policy" + dia: false + router_lsa: + - ad_type: "administrative" + time: 10 + route_policy: + - direction: "in" + pol_name: "ospf_in_policy" + area: + - a_num: 0 + stub: false + nssa: true + interface: + - name: "GigabitEthernet0/0" + hello_interval: "10" + dead_interval: "40" + retransmit_interval: "5" + cost: "1" + priority: "1" + network: "broadcast" + passive_interface: false + type: "simple" + message_digest_key: "1" + md5: "md5keystring" + range: + - address: "192.168.1.0/24" + cost: "100" + no_advertise: true + manager_credentials: + <<: *manager_authentication + + + + # INVALID + # - name: Create Comprehensive Cisco System Template + # cisco.catalystwan.feature_templates: + # state: present + # template_name: "ComprehensiveCiscoSystemTemplate" + # template_description: "Cisco System template" + # debug: true + # cisco_system: + # timezone: "UTC" + # hostname: + # name: "sdwan-hostname" # Replace with the actual hostname + # location: "Data Center A" + # latitude: "37.7749" + # longitude: "-122.4194" + # range: "10" + # enable_fencing: true + # mobile_number: + # - number: "+12345678901" + # - number: "+10987654321" + # enable_sms: true + # device_groups: + # - "group1" + # - "group2" + # controller_group_list: + # - "controller_group1" + # system_ip: + # name: "192.0.2.1" # Replace with the actual system IP + # overlay_id: "1" + # site_id: 1001 + # site_type: + # - "branch" + # - "spoke" + # port_offset: "1000" + # port_hop: true + # control_session_pps: "500" + # track_transport: true + # track_interface_tag: "eth0" + # console_baud_rate: "9600" + # max_omp_sessions: "50" + # multi_tenant: false + # track_default_gateway: false + # admin_tech_on_failure: true + # enable_tunnel: true + # idle_timeout: "300" + # on_demand_idle_timeout_min: "60" + # tracker: + # - name: "tracker1" + # endpoint_ip: "203.0.113.1" + # endpoint_ip_transport_port: "8080" + # protocol: "tcp" + # port: "443" + # endpoint_dns_name: "example.com" + # endpoint_api_url: "https://api.example.com" + # elements: + # - "element1" + # - "element2" + # boolean: "and" + # threshold: "10" + # interval: "30" + # multiplier: "3" + # type: "interface" + # object_track: + # - object_number: 10 + # interface: 'GigabitEthernet0/0/0' + # sig: '100' + # ip: '192.0.2.1' + # mask: '255.255.255.0' + # vpn: 1 + # object: + # - number: 101 + # boolean: 'and' + # - object_number: 20 + # interface: 'GigabitEthernet0/0/1' + # sig: '200' + # ip: '198.51.100.1' + # mask: '255.255.255.0' + # vpn: 2 + # object: + # - number: 201 + # boolean: 'or' + # preference: + # - 1 + # preference_auto: true + # epfr: "conservative" + # vrf: + # - vrf_id: 1 + # gateway_preference: + # - '192.0.2.1' + # - '192.0.2.2' + # - vrf_id: 2 + # gateway_preference: + # - '198.51.100.1' + # - '198.51.100.2' + # enable_management_region: true + # migration_bgp_community: '65535:12345' + # enable_mrf_migration: enabled + # transport_gateway: true + # affinity_group_number: 1 + # affinity_per_vrf: + # - affinity_group_number: 1 + # vrf_range: "22" + # role: 'vSmart' + # secondary_region: 'secondaryRegion' + # region_id: 'primaryRegion' + # manager_credentials: + # <<: *manager_authentication diff --git a/plugins/doc_fragments/feature_template_cisco_aaa.py b/plugins/doc_fragments/feature_template_cisco_aaa.py index 256c8f0..62d351c 100644 --- a/plugins/doc_fragments/feature_template_cisco_aaa.py +++ b/plugins/doc_fragments/feature_template_cisco_aaa.py @@ -17,9 +17,29 @@ class ModuleDocFragment(object): description: Cisco AAA Feature Template configuration type: dict suboptions: + authentication_group: + description: + - 'Whether to enable the authentication group, GUI equivalent: Authentication + Param' + required: false + default: false + type: bool + accounting_group: + description: + - 'Whether to enable the accounting group, GUI equivalent: Accounting + Param' + required: false + default: false + type: bool + server_auth_order: + description: + - ServerGroups authentication order to user access + required: false + default: local + type: str user: description: - - List of user configurations + - List of local user configurations required: false default: null type: list @@ -47,27 +67,132 @@ class ModuleDocFragment(object): description: - The privilege level for the user required: false - default: null + default: '15' type: str + choices: + - '1' + - '15' pubkey_chain: description: - List of public keys for the user required: false default: [] type: list - elements: str - authentication_group: + elements: dict + suboptions: + key_string: + description: + - Set the RSA key string + required: true + default: null + type: str + key_type: + description: + - Only RSA is supported + required: false + default: ssh-rsa + type: str + accounting_rules: description: - - Whether to enable the authentication group + - Configure the accounting rules + required: false + default: null + type: list + elements: dict + suboptions: + rule_id: + description: + - Accounting Rule ID + required: true + default: null + type: str + method: + description: + - Configure Accounting Method + required: true + default: null + type: str + choices: + - commands + - exec + - network + - system + level: + description: + - Privilege level when method is commands + required: false + default: null + type: str + choices: + - '1' + - '15' + start_stop: + description: + - Enable Start-Stop + required: false + default: true + type: bool + group: + description: + - List of groups. + required: true + default: null + type: str + authorization_console: + description: + - For enabling console authorization required: false default: null type: bool - accounting_group: + authorization_config_commands: description: - - Whether to enable the accounting group + - For configuration mode commands required: false default: null type: bool + authorization_rules: + description: + - Configure the accounting rules + required: false + default: null + type: list + elements: dict + suboptions: + rule_id: + description: + - Authorization Rule ID + required: true + default: null + type: str + method: + description: + - Configure Authorization Method + required: true + default: null + type: str + choices: + - commands + level: + description: + - Privilege level when method is commands + required: false + default: null + type: str + choices: + - '1' + - '15' + group: + description: + - List of groups. + required: true + default: null + type: str + authenticated: + description: + - Succeed if user has authenticated + required: false + default: false + type: bool radius: description: - List of Radius group configurations @@ -113,26 +238,26 @@ class ModuleDocFragment(object): - The authentication port for the RADIUS server required: false default: null - type: str + type: int acct_port: description: - The accounting port for the RADIUS server required: false default: null - type: str + type: int timeout: description: - The timeout period in seconds for the RADIUS server required: false default: null - type: str + type: int retransmit: description: - The number of retransmit attempts for the RADIUS server required: false default: null - type: str + type: int key: description: - The key for the RADIUS server @@ -157,6 +282,40 @@ class ModuleDocFragment(object): required: false default: null type: str + radius_client: + description: + - Specify a RADIUS client + required: false + default: null + type: list + elements: dict + suboptions: + ip: + description: + - The Client IP + required: true + default: null + type: str + vpn: + description: + - The VPN Configuration + required: true + default: null + type: list + elements: dict + suboptions: + name: + description: + - VPN ID + required: true + default: null + type: str + server_key: + description: + - Specify a RADIUS client server-key + required: false + default: null + type: str domain_stripping: description: - The domain stripping configuration @@ -167,9 +326,37 @@ class ModuleDocFragment(object): - 'yes' - 'no' - right-to-left + authentication_type: + description: + - Authentication Type + required: false + default: any + type: str + choices: + - any + - all + - session-key port: description: - - The port number for AAA + - Specify Radius Dynamic Author Port + required: false + default: null + type: str + server_key_password: + description: + - Specify a radius dynamic author server-key + required: false + default: null + type: str + cts_authorization_list: + description: + - Specify a radius dynamic author server-key + required: false + default: null + type: str + radius_trustsec_group: + description: + - RADIUS trustsec group required: false default: null type: str @@ -192,7 +379,7 @@ class ModuleDocFragment(object): - The VPN ID for the TACACS+ group required: false default: null - type: str + type: int source_interface: description: - The source interface for the TACACS+ group @@ -213,24 +400,24 @@ class ModuleDocFragment(object): required: true default: null type: str + key: + description: + - The key for the TACACS+ server + required: true + default: null + type: str port: description: - The port for the TACACS+ server required: false default: null - type: str + type: int timeout: description: - The timeout period in seconds for the TACACS+ server required: false default: null - type: str - key: - description: - - The key for the TACACS+ server - required: true - default: null - type: str + type: int secret_key: description: - The secret key for the TACACS+ server @@ -243,11 +430,4 @@ class ModuleDocFragment(object): required: false default: null type: str - server_auth_order: - description: - - Authentication order to user access - required: false - default: null - type: list - elements: str ''' \ No newline at end of file diff --git a/plugins/doc_fragments/feature_template_cisco_bfd.py b/plugins/doc_fragments/feature_template_cisco_bfd.py index f06e3d0..3377f4a 100644 --- a/plugins/doc_fragments/feature_template_cisco_bfd.py +++ b/plugins/doc_fragments/feature_template_cisco_bfd.py @@ -89,8 +89,8 @@ class ModuleDocFragment(object): description: - Whether to enable Path MTU Discovery required: false - default: null - type: str + default: true + type: bool dscp: description: - The DSCP value used for BFD packets diff --git a/plugins/doc_fragments/feature_template_cisco_logging.py b/plugins/doc_fragments/feature_template_cisco_logging.py index 07c6338..f1b910a 100644 --- a/plugins/doc_fragments/feature_template_cisco_logging.py +++ b/plugins/doc_fragments/feature_template_cisco_logging.py @@ -22,7 +22,7 @@ class ModuleDocFragment(object): - Whether logging to disk is enabled required: false default: null - type: str + type: bool size: description: - The maximum file size for the log file @@ -119,14 +119,14 @@ class ModuleDocFragment(object): description: - Whether to enable TLS encryption required: false - default: null - type: str + default: false + type: bool custom_profile: description: - Whether to use a custom TLS profile required: false - default: null - type: str + default: false + type: bool profile: description: - The custom TLS profile to use @@ -178,14 +178,14 @@ class ModuleDocFragment(object): description: - Whether to enable TLS encryption for the IPv6 server required: false - default: null - type: str + default: false + type: bool custom_profile: description: - Whether to use a custom TLS profile for the IPv6 server required: false - default: null - type: str + default: false + type: bool profile: description: - The custom TLS profile to use for the IPv6 server diff --git a/plugins/doc_fragments/feature_template_cisco_ntp.py b/plugins/doc_fragments/feature_template_cisco_ntp.py index 5d6593b..f5327ad 100644 --- a/plugins/doc_fragments/feature_template_cisco_ntp.py +++ b/plugins/doc_fragments/feature_template_cisco_ntp.py @@ -60,7 +60,7 @@ class ModuleDocFragment(object): - Whether this server is preferred over others required: false default: null - type: str + type: bool authentication: description: - List of authentication keys @@ -74,7 +74,7 @@ class ModuleDocFragment(object): - The authentication key number required: true default: null - type: str + type: int md5: description: - The MD5 hash used for authentication @@ -93,7 +93,7 @@ class ModuleDocFragment(object): - Whether the device is an NTP master required: false default: null - type: str + type: bool stratum: description: - The stratum level if the device is an NTP master diff --git a/plugins/doc_fragments/feature_template_cisco_omp.py b/plugins/doc_fragments/feature_template_cisco_omp.py index 827ed95..6c35d42 100644 --- a/plugins/doc_fragments/feature_template_cisco_omp.py +++ b/plugins/doc_fragments/feature_template_cisco_omp.py @@ -22,8 +22,8 @@ class ModuleDocFragment(object): description: - Enable or disable graceful restart for OMP. required: false - default: null - type: str + default: true + type: bool overlay_as: description: - The autonomous system number used for the overlay. @@ -47,7 +47,7 @@ class ModuleDocFragment(object): - Enable or disable the shutdown of OMP. required: false default: null - type: str + type: bool omp_admin_distance_ipv4: description: - The administrative distance for IPv4 routes learned via OMP. @@ -144,8 +144,8 @@ class ModuleDocFragment(object): description: - Whether to ignore the region part of the path length for OMP routes. required: false - default: null - type: str + default: false + type: bool transport_gateway: description: - Specifies the preferred transport gateway selection strategy. @@ -175,6 +175,6 @@ class ModuleDocFragment(object): description: - Enable or disable automatic translation of network settings. required: false - default: null - type: str + default: false + type: bool ''' \ No newline at end of file diff --git a/plugins/doc_fragments/feature_template_cisco_ospf.py b/plugins/doc_fragments/feature_template_cisco_ospf.py index dbfccba..9295957 100644 --- a/plugins/doc_fragments/feature_template_cisco_ospf.py +++ b/plugins/doc_fragments/feature_template_cisco_ospf.py @@ -33,21 +33,21 @@ class ModuleDocFragment(object): description: - Compatibility switch for RFC 1583. required: false - default: null - type: str + default: true + type: bool originate: description: - Controls the origination of default information into the OSPF domain. required: false default: null - type: str + type: bool always: description: - Ensures that the default route is always advertised, regardless of the existence of a default route in the routing table. required: false default: null - type: str + type: bool metric: description: - The metric value to be set for the default route advertised by OSPF. @@ -132,8 +132,8 @@ class ModuleDocFragment(object): - Default information originate, which controls the advertisement of default route. required: false - default: null - type: str + default: true + type: bool router_lsa: description: - Configuration options for the Router LSA in OSPF. @@ -156,7 +156,7 @@ class ModuleDocFragment(object): - Time in seconds for advertisement. required: true default: null - type: str + type: int route_policy: description: - A list of OSPF route policies. @@ -192,21 +192,21 @@ class ModuleDocFragment(object): - The OSPF area number. required: true default: null - type: str + type: int stub: description: - Configuration for the OSPF area to be a stub area. If set, no-summary can be applied. required: false default: null - type: str + type: bool nssa: description: - Configuration for the OSPF area to be a Not-So-Stubby Area (NSSA). If set, no-summary can be applied. required: false default: null - type: str + type: bool interface: description: - A list of OSPF interface configurations associated with @@ -270,8 +270,8 @@ class ModuleDocFragment(object): description: - Whether the interface is a passive OSPF interface. required: false - default: null - type: str + default: false + type: bool type: description: - The OSPF authentication type for the interface. @@ -320,6 +320,6 @@ class ModuleDocFragment(object): description: - Whether to suppress advertising this range. required: false - default: null - type: str + default: false + type: bool ''' \ No newline at end of file diff --git a/plugins/doc_fragments/feature_template_cisco_secure_internet_gateway.py b/plugins/doc_fragments/feature_template_cisco_secure_internet_gateway.py index 5fa822a..2cabe78 100644 --- a/plugins/doc_fragments/feature_template_cisco_secure_internet_gateway.py +++ b/plugins/doc_fragments/feature_template_cisco_secure_internet_gateway.py @@ -22,7 +22,7 @@ class ModuleDocFragment(object): - VPN ID associated with the Cisco Secure Internet Gateway service. required: false default: null - type: str + type: int interface: description: - List of interface configurations associated with the service. @@ -130,7 +130,7 @@ class ModuleDocFragment(object): - MTU (Maximum Transmission Unit) size for the interface. required: false default: null - type: str + type: int dpd_interval: description: - Dead Peer Detection (DPD) interval in seconds. @@ -148,7 +148,7 @@ class ModuleDocFragment(object): - Internet Key Exchange (IKE) protocol version. required: false default: null - type: str + type: int pre_shared_secret: description: - Pre-shared secret key for IKE authentication. @@ -289,7 +289,7 @@ class ModuleDocFragment(object): in failover decisions. required: false default: null - type: str + type: int backup_interface: description: - Name of the backup interface. Can be 'None' if no @@ -303,7 +303,7 @@ class ModuleDocFragment(object): in failover decisions. required: false default: null - type: str + type: int auth_required: description: - Flag indicating if authentication is required for the service. @@ -340,14 +340,14 @@ class ModuleDocFragment(object): - Primary data center for the service. 'Auto' for automatic selection. required: false - default: null + default: Auto type: str secondary_data_center: description: - Secondary data center for the service. 'Auto' for automatic selection. required: false - default: null + default: Auto type: str ip: description: @@ -424,14 +424,14 @@ class ModuleDocFragment(object): description: - Alias for the primary data center setting. required: false - default: null + default: Auto type: str data_center_secondary: description: - Secondary data center for the service. 'Auto' for automatic selection or a specific identifier for a manual selection. required: false - default: null + default: Auto type: str tracker_src_ip: description: diff --git a/plugins/doc_fragments/feature_template_cisco_snmp.py b/plugins/doc_fragments/feature_template_cisco_snmp.py index 876c04d..fb5c544 100644 --- a/plugins/doc_fragments/feature_template_cisco_snmp.py +++ b/plugins/doc_fragments/feature_template_cisco_snmp.py @@ -21,18 +21,18 @@ class ModuleDocFragment(object): description: - Indicates whether SNMP is administratively shut down required: false - default: null - type: str + default: true + type: bool contact: description: - The contact information for the SNMP administrator - required: true + required: false default: null type: str location: description: - The physical location information for the SNMP agent - required: true + required: false default: null type: str view: @@ -52,7 +52,7 @@ class ModuleDocFragment(object): oid: description: - List of OIDs to include or exclude in the view - required: true + required: false default: null type: list elements: dict @@ -68,9 +68,9 @@ class ModuleDocFragment(object): description: - Indicates whether the OID should be excluded from the view - required: true + required: false default: null - type: str + type: bool community: description: - List of SNMP communities for different access rights @@ -146,7 +146,7 @@ class ModuleDocFragment(object): auth: description: - The authentication protocol used - required: true + required: false default: null type: str choices: @@ -155,7 +155,7 @@ class ModuleDocFragment(object): auth_password: description: - The password for authentication - required: true + required: false default: null type: str priv: @@ -169,7 +169,7 @@ class ModuleDocFragment(object): priv_password: description: - The password for privacy - required: true + required: false default: null type: str group: @@ -191,7 +191,7 @@ class ModuleDocFragment(object): - The VPN ID where the SNMP target resides required: true default: null - type: str + type: int ip: description: - The IP address of the SNMP target @@ -203,23 +203,23 @@ class ModuleDocFragment(object): - The port number for the SNMP target required: true default: null - type: str + type: int community_name: description: - The community name for the SNMP target - required: true + required: false default: null type: str user: description: - The user name for the SNMP target - required: true + required: false default: null type: str source_interface: description: - The source interface for sending SNMP traps - required: true + required: false default: null type: str ''' \ No newline at end of file diff --git a/plugins/doc_fragments/feature_template_cisco_system.py b/plugins/doc_fragments/feature_template_cisco_system.py index acf3b61..3cb9cef 100644 --- a/plugins/doc_fragments/feature_template_cisco_system.py +++ b/plugins/doc_fragments/feature_template_cisco_system.py @@ -444,7 +444,7 @@ class ModuleDocFragment(object): description: - The hostname for the device. required: false - default: null + default: system_host_name type: dict suboptions: name: @@ -482,7 +482,7 @@ class ModuleDocFragment(object): - Enable or disable geo-fencing. required: false default: null - type: str + type: bool mobile_number: description: - List of mobile numbers for SMS notifications. @@ -502,8 +502,8 @@ class ModuleDocFragment(object): description: - Enable or disable SMS notifications. required: false - default: null - type: str + default: false + type: bool device_groups: description: - List of device groups the device belongs to. @@ -522,7 +522,7 @@ class ModuleDocFragment(object): description: - The system IP address of the device. required: false - default: null + default: system_system_ip type: dict suboptions: name: @@ -541,8 +541,8 @@ class ModuleDocFragment(object): description: - The site ID of the device. required: false - default: null - type: str + default: system_site_id + type: int site_type: description: - The site type classification for the device. @@ -569,7 +569,7 @@ class ModuleDocFragment(object): - Enable or disable port hopping. required: false default: null - type: str + type: bool control_session_pps: description: - Control session packets per second setting. @@ -581,7 +581,7 @@ class ModuleDocFragment(object): - Enable or disable transport tracking. required: false default: null - type: str + type: bool track_interface_tag: description: - The tag of the interface to be tracked. @@ -614,26 +614,26 @@ class ModuleDocFragment(object): - Enable or disable multi-tenant support. required: false default: null - type: str + type: bool track_default_gateway: description: - Enable or disable default gateway tracking. required: false default: null - type: str + type: bool admin_tech_on_failure: description: - Enable or disable automatic generation of admin technical details on failure. required: false default: null - type: str + type: bool enable_tunnel: description: - Enable or disable tunnel functionality. required: false default: null - type: str + type: bool idle_timeout: description: - The idle timeout setting for tunnels. @@ -755,7 +755,7 @@ class ModuleDocFragment(object): - The tracking object number. required: true default: null - type: str + type: int interface: description: - The name of the interface to track. @@ -778,14 +778,14 @@ class ModuleDocFragment(object): description: - The subnet mask associated with the IP address for tracking. required: false - default: null + default: 0.0.0.0 type: str vpn: description: - The VPN instance associated with the tracking object. required: true default: null - type: str + type: int object: description: - A list of objects related to the tracking. @@ -799,7 +799,7 @@ class ModuleDocFragment(object): - The unique identifier for the object. required: true default: null - type: str + type: int boolean: description: - The boolean condition to use when evaluating multiple objects. @@ -848,7 +848,7 @@ class ModuleDocFragment(object): - Enable or disable automatic preference setting for affinity groups. required: false default: null - type: str + type: bool affinity_per_vrf: description: - List of affinity configurations per VRF. @@ -874,7 +874,7 @@ class ModuleDocFragment(object): - Enable or disable the transport gateway feature. required: false default: null - type: str + type: bool enable_mrf_migration: description: - Enable Multicast Routing Framework (MRF) migration settings. @@ -895,7 +895,7 @@ class ModuleDocFragment(object): - Enable or disable management region configuration. required: false default: null - type: str + type: bool vrf: description: - List of VRF configurations. @@ -909,7 +909,7 @@ class ModuleDocFragment(object): - The VRF (VPN Routing and Forwarding) instance ID. required: true default: null - type: str + type: int gateway_preference: description: - A list of preferred gateway values for the VRF. @@ -922,7 +922,7 @@ class ModuleDocFragment(object): - Enable or disable the management gateway feature. required: false default: null - type: str + type: bool epfr: description: - Edge Policy-based Framework Routing (EPFR) setting. diff --git a/plugins/doc_fragments/feature_template_cisco_vpn.py b/plugins/doc_fragments/feature_template_cisco_vpn.py index 3c4f78e..72e0779 100644 --- a/plugins/doc_fragments/feature_template_cisco_vpn.py +++ b/plugins/doc_fragments/feature_template_cisco_vpn.py @@ -22,7 +22,7 @@ class ModuleDocFragment(object): - The unique identifier for the VPN instance (VRF). required: false default: null - type: str + type: int vpn_name: description: - The name of the VPN instance. @@ -193,7 +193,7 @@ class ModuleDocFragment(object): - The VPN identifier where the service route is to be applied. required: true default: null - type: str + type: int service: description: - The service associated with the route. @@ -372,7 +372,7 @@ class ModuleDocFragment(object): - The VPN identifier where the GRE route is to be applied. required: true default: null - type: str + type: int interface: description: - A list of interfaces associated with the GRE route. @@ -400,7 +400,7 @@ class ModuleDocFragment(object): - The VPN identifier where the IPSec route is to be applied. required: true default: null - type: str + type: int interface: description: - A list of interfaces associated with the IPSec route. @@ -620,7 +620,7 @@ class ModuleDocFragment(object): - The identifier for the NAT pool. required: true default: null - type: str + type: int prefix_length: description: - The length of the network prefix for the NAT pool. @@ -736,7 +736,7 @@ class ModuleDocFragment(object): NAT. required: true default: null - type: str + type: int static_nat_direction: description: - The direction (inside or outside) for the subnet static @@ -774,14 +774,14 @@ class ModuleDocFragment(object): - The source port number for the port forwarding rule. required: true default: null - type: str + type: int translate_port: description: - The destination port number to which the source port is translated. required: true default: null - type: str + type: int source_ip: description: - The source IP address for the port forwarding rule. @@ -876,7 +876,7 @@ class ModuleDocFragment(object): - The VPN instance (VRF) from which routes are to be imported. required: true default: null - type: str + type: int protocol: description: - The routing protocol from which routes are to be imported. diff --git a/plugins/doc_fragments/feature_template_cisco_vpn_interface.py b/plugins/doc_fragments/feature_template_cisco_vpn_interface.py index 431e4a1..5b6c2c4 100644 --- a/plugins/doc_fragments/feature_template_cisco_vpn_interface.py +++ b/plugins/doc_fragments/feature_template_cisco_vpn_interface.py @@ -35,7 +35,7 @@ class ModuleDocFragment(object): False otherwise. required: false default: null - type: str + type: bool ipv4_address: description: - The primary IPv4 address assigned to the interface. @@ -62,7 +62,7 @@ class ModuleDocFragment(object): True if enabled, False otherwise. required: false default: null - type: str + type: bool dhcp_distance: description: - Administrative distance for DHCP routes on the interface. @@ -81,7 +81,7 @@ class ModuleDocFragment(object): True if enabled, False otherwise. required: false default: null - type: str + type: bool secondary_ipv6_address: description: - A list of secondary IPv6 addresses assigned to the interface. @@ -160,7 +160,7 @@ class ModuleDocFragment(object): True if enabled, False otherwise. required: false default: null - type: str + type: bool iperf_server: description: - The IP address of the iPerf server used for performance testing @@ -174,7 +174,7 @@ class ModuleDocFragment(object): the interface. required: false default: null - type: str + type: bool nat_choice: description: - The type of NAT configured on the interface, if applicable. @@ -216,7 +216,7 @@ class ModuleDocFragment(object): - Indicates if NAT overload (PAT - Port Address Translation) is enabled. required: false default: null - type: str + type: bool loopback_interface: description: - The associated loopback interface, if any, for the VPN interface. @@ -235,21 +235,21 @@ class ModuleDocFragment(object): - Indicates whether the interface is enabled or disabled. required: false default: null - type: str + type: bool nat64: description: - Indicates whether NAT64 is enabled on the interface, allowing IPv6 addresses to communicate with IPv4 services. required: false default: null - type: str + type: bool nat66: description: - Indicates whether NAT66 is enabled on the interface, translating IPv6 addresses into IPv6 addresses. required: false default: null - type: str + type: bool static_nat66: description: - List of static NAT66 entries for translating IPv6 addresses into @@ -276,7 +276,7 @@ class ModuleDocFragment(object): - VPN ID associated with the source network prefix. required: false default: null - type: str + type: int static: description: - List of static NAT entries for configuring one-to-one address mappings. @@ -311,7 +311,7 @@ class ModuleDocFragment(object): - VPN ID associated with the source IP for static NAT. required: false default: null - type: str + type: int static_port_forward: description: - List of static port forwarding entries for the interface. @@ -346,13 +346,13 @@ class ModuleDocFragment(object): - Source port number for port forwarding. required: false default: null - type: str + type: int translate_port: description: - Translated port number for port forwarding. required: false default: null - type: str + type: int proto: description: - Protocol used for port forwarding (TCP/UDP). @@ -367,14 +367,14 @@ class ModuleDocFragment(object): - VPN ID associated with the source IP for port forwarding. required: false default: null - type: str + type: int enable_core_region: description: - Indicates if the interface is part of the core network region for centralized services. required: false default: null - type: str + type: bool core_region: description: - Configuration details for the core region. @@ -424,25 +424,25 @@ class ModuleDocFragment(object): decisions. required: false default: null - type: str + type: int border: description: - Defines if the interface is at the border of a network segment. required: false default: null - type: str + type: bool per_tunnel_qos: description: - Enable or disable per-tunnel Quality of Service (QoS). required: false default: null - type: str + type: bool per_tunnel_qos_aggregator: description: - Enable or disable per-tunnel QoS aggregator. required: false default: null - type: str + type: bool mode: description: - Defines the operating mode for the interface. @@ -507,14 +507,14 @@ class ModuleDocFragment(object): - Enables or disables control connections on the interface. required: false default: null - type: str + type: bool vbond_as_stun_server: description: - Configures the vBond orchestrator to act as a STUN server for the interface. required: false default: null - type: str + type: bool exclude_controller_group_list: description: - List of controller groups to exclude from connections. @@ -534,13 +534,13 @@ class ModuleDocFragment(object): blocking. required: false default: null - type: str + type: bool restrict: description: - Indicates whether the interface color is restricted for use. required: false default: null - type: str + type: bool dst_ip: description: - Destination IP address for GRE (Generic Routing Encapsulation) tunnel @@ -597,13 +597,13 @@ class ModuleDocFragment(object): back to. required: false default: null - type: str + type: bool low_bandwidth_link: description: - Indicates if the link is considered a low bandwidth link. required: false default: null - type: str + type: bool tunnel_tcp_mss_adjust: description: - Adjusts the Maximum Segment Size (MSS) value for TCP connections @@ -617,102 +617,102 @@ class ModuleDocFragment(object): in the IP header. required: false default: null - type: str + type: bool propagate_sgt: description: - Enables or disables the propagation of Security Group Tags (SGTs) across the tunnel interface. required: false default: null - type: str + type: bool network_broadcast: description: - Allows or disallows network broadcast traffic through the tunnel interface. required: false default: null - type: str + type: bool all: description: - Permits or denies all services through the tunnel interface. required: false default: null - type: str + type: bool bgp: description: - Allows or disallows Border Gateway Protocol (BGP) traffic through the tunnel interface. required: false default: null - type: str + type: bool dhcp: description: - Enables or disables Dynamic Host Configuration Protocol (DHCP) on the tunnel interface. required: false default: null - type: str + type: bool dns: description: - Allows or disallows Domain Name System (DNS) queries through the tunnel interface. required: false default: null - type: str + type: bool icmp: description: - Enables or disables Internet Control Message Protocol (ICMP) for ping and traceroute through the tunnel interface. required: false default: null - type: str + type: bool sshd: description: - Allows or disallows Secure Shell (SSH) daemon access through the tunnel interface. required: false default: null - type: str + type: bool netconf: description: - Enables or disables NETCONF protocol support on the tunnel interface. required: false default: null - type: str + type: bool ntp: description: - Allows or disallows Network Time Protocol (NTP) synchronization through the tunnel interface. required: false default: null - type: str + type: bool ospf: description: - Permits or denies Open Shortest Path First (OSPF) routing protocol traffic through the tunnel interface. required: false default: null - type: str + type: bool stun: description: - Enables or disables Session Traversal Utilities for NAT (STUN) on the tunnel interface. required: false default: null - type: str + type: bool snmp: description: - Allows or disallows Simple Network Management Protocol (SNMP) through the tunnel interface. required: false default: null - type: str + type: bool https: description: - Permits or denies HTTPS traffic through the tunnel interface. required: false default: null - type: str + type: bool media_type: description: - Specifies the media type used by the interface, such as copper or @@ -801,8 +801,8 @@ class ModuleDocFragment(object): description: - Enables or disables (shuts down) the interface. required: false - default: null - type: str + default: false + type: bool arp_timeout: description: - Time in seconds before an ARP cache entry is timed out. @@ -815,25 +815,25 @@ class ModuleDocFragment(object): on the interface. required: false default: null - type: str + type: bool ip_directed_broadcast: description: - Allows or disallows IP directed broadcasts on the interface. required: false default: null - type: str + type: bool icmp_redirect_disable: description: - Enables or disables ICMP redirect messages on the interface. required: false default: null - type: str + type: bool qos_adaptive: description: - Activates or deactivates adaptive QoS on the interface. required: false default: null - type: str + type: bool period: description: - Time period in seconds for measuring and adapting QoS settings. @@ -922,7 +922,7 @@ class ModuleDocFragment(object): IP addresses. required: false default: null - type: str + type: bool rule_name: description: - Specifies the name of the rewrite rule applied to the interface. @@ -988,19 +988,19 @@ class ModuleDocFragment(object): - VRRP group ID. required: true default: null - type: str + type: int priority: description: - Priority value for the VRRP group (higher values take precedence). required: false default: null - type: str + type: int timer: description: - VRRP advertisement interval timer in milliseconds. required: false default: null - type: str + type: int track_omp: description: - Flag to track Overlay Management Protocol (OMP) session @@ -1045,7 +1045,7 @@ class ModuleDocFragment(object): - VRRP value to determine the primary node for the VRRP group. required: true default: null - type: str + type: int tracking_object: description: - List of tracking objects associated with the VRRP configuration. @@ -1059,7 +1059,7 @@ class ModuleDocFragment(object): - Unique identifier for the tracking object. required: true default: null - type: str + type: int track_action: description: - Action to take when the tracked object state changes @@ -1076,7 +1076,7 @@ class ModuleDocFragment(object): the tracked object is down. required: true default: null - type: str + type: int ipv6_vrrp: description: - A list of Virtual Router Redundancy Protocol (VRRP) configurations @@ -1091,20 +1091,20 @@ class ModuleDocFragment(object): - IPv6 VRRP group ID. required: true default: null - type: str + type: int priority: description: - Priority value for the IPv6 VRRP group (higher values take precedence). required: false default: null - type: str + type: int timer: description: - IPv6 VRRP advertisement interval timer in milliseconds. required: false default: null - type: str + type: int track_omp: description: - Flag to track Overlay Management Protocol (OMP) session @@ -1145,7 +1145,7 @@ class ModuleDocFragment(object): - Enables or disables Security Group Tag (SGT) propagation. required: false default: null - type: str + type: bool security_group_tag: description: - Specifies a static Security Group Tag (SGT) for the interface. @@ -1157,19 +1157,19 @@ class ModuleDocFragment(object): - Marks the interface as trusted or untrusted for TrustSec. required: false default: null - type: str + type: bool enable_sgt_authorization_and_forwarding: description: - Enables or disables Security Group Tag (SGT) authorization and forwarding. required: false default: null - type: str + type: bool enable_sgt_enforcement: description: - Activates or deactivates Security Group Tag (SGT) enforcement. required: false default: null - type: str + type: bool enforcement_sgt: description: - Specifies the Security Group Tag (SGT) to be enforced on the interface. diff --git a/plugins/doc_fragments/feature_template_omp_vsmart.py b/plugins/doc_fragments/feature_template_omp_vsmart.py index ca94a83..8273468 100644 --- a/plugins/doc_fragments/feature_template_omp_vsmart.py +++ b/plugins/doc_fragments/feature_template_omp_vsmart.py @@ -22,7 +22,7 @@ class ModuleDocFragment(object): - Enable or disable graceful restart for the OMP session required: false default: null - type: str + type: bool send_path_limit: description: - The maximum number of paths that can be sent to a TLOC @@ -34,20 +34,20 @@ class ModuleDocFragment(object): - Enable or disable sending additional backup paths required: false default: null - type: str + type: bool discard_rejected: description: - Discard routes that are rejected by policy instead of marking them as rejected required: false default: null - type: str + type: bool shutdown: description: - Enable or disable the shutdown of the OMP session required: false default: null - type: str + type: bool graceful_restart_timer: description: - The time interval for graceful restart of OMP sessions @@ -71,7 +71,7 @@ class ModuleDocFragment(object): - Prefer routes from the same affinity group required: false default: null - type: str + type: bool advertisement_interval: description: - Interval between sending OMP route advertisements diff --git a/plugins/module_utils/feature_templates/cisco_aaa.py b/plugins/module_utils/feature_templates/cisco_aaa.py index bf07afe..2630f40 100644 --- a/plugins/module_utils/feature_templates/cisco_aaa.py +++ b/plugins/module_utils/feature_templates/cisco_aaa.py @@ -1,10 +1,60 @@ cisco_aaa_definition = { 'cisco_aaa': { 'default': None, - 'options': { 'accounting_group': { 'default': None, + 'options': { 'accounting_group': { 'default': False, 'required': False, 'type': 'bool'}, - 'authentication_group': { 'default': None, + 'accounting_rules': { 'default': None, + 'elements': 'dict', + 'options': { 'group': { 'default': None, + 'required': True, + 'type': 'str'}, + 'level': { 'default': None, + 'required': False, + 'type': 'str'}, + 'method': { 'default': None, + 'required': True, + 'type': 'str'}, + 'rule_id': { 'default': None, + 'required': True, + 'type': 'str'}, + 'start_stop': { 'default': True, + 'required': False, + 'type': 'bool'}}, + 'required': False, + 'type': 'list'}, + 'authentication_group': { 'default': False, 'required': False, 'type': 'bool'}, + 'authentication_type': { 'default': 'any', + 'required': False, + 'type': 'str'}, + 'authorization_config_commands': { 'default': None, + 'required': False, + 'type': 'bool'}, + 'authorization_console': { 'default': None, + 'required': False, + 'type': 'bool'}, + 'authorization_rules': { 'default': None, + 'elements': 'dict', + 'options': { 'authenticated': { 'default': False, + 'required': False, + 'type': 'bool'}, + 'group': { 'default': None, + 'required': True, + 'type': 'str'}, + 'level': { 'default': None, + 'required': False, + 'type': 'str'}, + 'method': { 'default': None, + 'required': True, + 'type': 'str'}, + 'rule_id': { 'default': None, + 'required': True, + 'type': 'str'}}, + 'required': False, + 'type': 'list'}, + 'cts_authorization_list': { 'default': None, + 'required': False, + 'type': 'str'}, 'domain_stripping': { 'default': None, 'required': False, 'type': 'str'}, @@ -20,13 +70,13 @@ 'elements': 'dict', 'options': { 'acct_port': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'address': { 'default': None, 'required': True, 'type': 'str'}, 'auth_port': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'key': { 'default': None, 'required': True, 'type': 'str'}, @@ -38,13 +88,13 @@ 'type': 'str'}, 'retransmit': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'secret_key': { 'default': None, 'required': False, 'type': 'str'}, 'timeout': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'source_interface': { 'default': None, @@ -55,10 +105,32 @@ 'type': 'str'}}, 'required': False, 'type': 'list'}, - 'server_auth_order': { 'default': None, - 'elements': 'str', + 'radius_client': { 'default': None, + 'elements': 'dict', + 'options': { 'ip': { 'default': None, + 'required': True, + 'type': 'str'}, + 'vpn': { 'default': None, + 'elements': 'dict', + 'options': { 'name': { 'default': None, + 'required': True, + 'type': 'str'}, + 'server_key': { 'default': None, + 'required': False, + 'type': 'str'}}, + 'required': True, + 'type': 'list'}}, + 'required': False, + 'type': 'list'}, + 'radius_trustsec_group': { 'default': None, + 'required': False, + 'type': 'str'}, + 'server_auth_order': { 'default': 'local', 'required': False, - 'type': 'list'}, + 'type': 'str'}, + 'server_key_password': { 'default': None, + 'required': False, + 'type': 'str'}, 'tacacs': { 'default': None, 'elements': 'dict', 'options': { 'group_name': { 'default': None, @@ -77,13 +149,13 @@ 'type': 'str'}, 'port': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'secret_key': { 'default': None, 'required': False, 'type': 'str'}, 'timeout': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'source_interface': { 'default': None, @@ -91,7 +163,7 @@ 'type': 'str'}, 'vpn': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'user': { 'default': None, @@ -102,11 +174,17 @@ 'password': { 'default': None, 'required': False, 'type': 'str'}, - 'privilege': { 'default': None, + 'privilege': { 'default': '15', 'required': False, 'type': 'str'}, 'pubkey_chain': { 'default': [ ], - 'elements': 'str', + 'elements': 'dict', + 'options': { 'key_string': { 'default': None, + 'required': True, + 'type': 'str'}, + 'key_type': { 'default': 'ssh-rsa', + 'required': False, + 'type': 'str'}}, 'required': False, 'type': 'list'}, 'secret': { 'default': None, diff --git a/plugins/module_utils/feature_templates/cisco_bfd.py b/plugins/module_utils/feature_templates/cisco_bfd.py index 93b4f37..c2767d2 100644 --- a/plugins/module_utils/feature_templates/cisco_bfd.py +++ b/plugins/module_utils/feature_templates/cisco_bfd.py @@ -13,9 +13,9 @@ 'multiplier': { 'default': None, 'required': False, 'type': 'str'}, - 'pmtu_discovery': { 'default': None, + 'pmtu_discovery': { 'default': True, 'required': False, - 'type': 'str'}}, + 'type': 'bool'}}, 'required': False, 'type': 'list'}, 'default_dscp': { 'default': None, diff --git a/plugins/module_utils/feature_templates/cisco_logging.py b/plugins/module_utils/feature_templates/cisco_logging.py index 423d827..2608fb3 100644 --- a/plugins/module_utils/feature_templates/cisco_logging.py +++ b/plugins/module_utils/feature_templates/cisco_logging.py @@ -1,15 +1,15 @@ cisco_logging_definition = { 'cisco_logging': { 'default': None, 'options': { 'enable': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'ipv6_server': { 'default': None, 'elements': 'dict', - 'options': { 'custom_profile': { 'default': None, + 'options': { 'custom_profile': { 'default': False, 'required': False, - 'type': 'str'}, - 'enable_tls': { 'default': None, + 'type': 'bool'}, + 'enable_tls': { 'default': False, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'name': { 'default': None, 'required': True, 'type': 'str'}, @@ -32,12 +32,12 @@ 'type': 'str'}, 'server': { 'default': None, 'elements': 'dict', - 'options': { 'custom_profile': { 'default': None, + 'options': { 'custom_profile': { 'default': False, 'required': False, - 'type': 'str'}, - 'enable_tls': { 'default': None, + 'type': 'bool'}, + 'enable_tls': { 'default': False, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'name': { 'default': None, 'required': True, 'type': 'str'}, diff --git a/plugins/module_utils/feature_templates/cisco_ntp.py b/plugins/module_utils/feature_templates/cisco_ntp.py index 321b93a..d29ba18 100644 --- a/plugins/module_utils/feature_templates/cisco_ntp.py +++ b/plugins/module_utils/feature_templates/cisco_ntp.py @@ -6,12 +6,12 @@ 'type': 'str'}, 'number': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'enable': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'server': { 'default': [], 'elements': 'dict', 'options': { 'key': { 'default': None, @@ -22,7 +22,7 @@ 'type': 'str'}, 'prefer': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'source_interface': { 'default': None, 'required': False, 'type': 'str'}, diff --git a/plugins/module_utils/feature_templates/cisco_omp.py b/plugins/module_utils/feature_templates/cisco_omp.py index 358c5c0..e0c6bb0 100644 --- a/plugins/module_utils/feature_templates/cisco_omp.py +++ b/plugins/module_utils/feature_templates/cisco_omp.py @@ -12,27 +12,27 @@ 'advertisement_interval': { 'default': None, 'required': False, 'type': 'str'}, - 'auto_translate': { 'default': None, + 'auto_translate': { 'default': False, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'ecmp_limit': { 'default': None, 'required': False, 'type': 'str'}, 'eor_timer': { 'default': None, 'required': False, 'type': 'str'}, - 'graceful_restart': { 'default': None, + 'graceful_restart': { 'default': True, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'graceful_restart_timer': { 'default': None, 'required': False, 'type': 'str'}, 'holdtime': { 'default': None, 'required': False, 'type': 'str'}, - 'ignore_region_path_length': { 'default': None, + 'ignore_region_path_length': { 'default': False, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'ipv6_advertise': { 'default': None, 'elements': 'dict', 'options': { 'protocol': { 'default': None, @@ -54,7 +54,7 @@ 'type': 'str'}, 'shutdown': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'site_types': { 'default': None, 'elements': 'str', 'required': False, diff --git a/plugins/module_utils/feature_templates/cisco_ospf.py b/plugins/module_utils/feature_templates/cisco_ospf.py index fae5255..5012f3e 100644 --- a/plugins/module_utils/feature_templates/cisco_ospf.py +++ b/plugins/module_utils/feature_templates/cisco_ospf.py @@ -1,12 +1,12 @@ cisco_ospf_definition = { 'cisco_ospf': { 'default': None, 'options': { 'always': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'area': { 'default': None, 'elements': 'dict', 'options': { 'a_num': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'interface': { 'default': None, 'elements': 'dict', 'options': { 'cost': { 'default': None, @@ -30,9 +30,9 @@ 'network': { 'default': 'broadcast', 'required': False, 'type': 'str'}, - 'passive_interface': { 'default': None, + 'passive_interface': { 'default': False, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'priority': { 'default': None, 'required': False, 'type': 'str'}, @@ -46,7 +46,7 @@ 'type': 'list'}, 'nssa': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'range': { 'default': None, 'elements': 'dict', 'options': { 'address': { 'default': None, @@ -55,14 +55,14 @@ 'cost': { 'default': None, 'required': False, 'type': 'str'}, - 'no_advertise': { 'default': None, + 'no_advertise': { 'default': False, 'required': False, - 'type': 'str'}}, + 'type': 'bool'}}, 'required': False, 'type': 'list'}, 'stub': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'bool'}}, 'required': False, 'type': 'list'}, 'delay': { 'default': None, @@ -91,12 +91,12 @@ 'type': 'str'}, 'originate': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'redistribute': { 'default': None, 'elements': 'dict', - 'options': { 'dia': { 'default': None, + 'options': { 'dia': { 'default': True, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'protocol': { 'default': None, 'required': True, 'type': 'str'}, @@ -108,9 +108,9 @@ 'reference_bandwidth': { 'default': None, 'required': False, 'type': 'str'}, - 'rfc1583': { 'default': None, + 'rfc1583': { 'default': True, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'route_policy': { 'default': None, 'elements': 'dict', 'options': { 'direction': { 'default': None, @@ -131,7 +131,7 @@ 'type': 'str'}, 'time': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}}, 'required': False, diff --git a/plugins/module_utils/feature_templates/cisco_secure_internet_gateway.py b/plugins/module_utils/feature_templates/cisco_secure_internet_gateway.py index 860ab51..0d49278 100644 --- a/plugins/module_utils/feature_templates/cisco_secure_internet_gateway.py +++ b/plugins/module_utils/feature_templates/cisco_secure_internet_gateway.py @@ -39,7 +39,7 @@ 'type': 'str'}, 'ike_version': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'ipsec_ciphersuite': { 'default': 'aes256-gcm', 'required': False, 'type': 'str'}, @@ -51,7 +51,7 @@ 'type': 'str'}, 'mtu': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'perfect_forward_secrecy': { 'default': 'none', 'required': False, 'type': 'str'}, @@ -107,10 +107,10 @@ 'caution_enabled': { 'default': None, 'required': False, 'type': 'str'}, - 'data_center_primary': { 'default': None, + 'data_center_primary': { 'default': 'Auto', 'required': False, 'type': 'str'}, - 'data_center_secondary': { 'default': None, + 'data_center_secondary': { 'default': 'Auto', 'required': False, 'type': 'str'}, 'display_time_unit': { 'default': 'MINUTE', @@ -132,13 +132,13 @@ 'type': 'str'}, 'active_interface_weight': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'backup_interface': { 'default': None, 'required': False, 'type': 'str'}, 'backup_interface_weight': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'int'}}, 'required': True, 'type': 'list'}, 'ip': { 'default': None, @@ -153,7 +153,7 @@ 'ofw_enabled': { 'default': None, 'required': False, 'type': 'str'}, - 'primary_data_center': { 'default': None, + 'primary_data_center': { 'default': 'Auto', 'required': False, 'type': 'str'}, 'refresh_time': { 'default': None, @@ -162,7 +162,7 @@ 'refresh_time_unit': { 'default': 'MINUTE', 'required': False, 'type': 'str'}, - 'secondary_data_center': { 'default': None, + 'secondary_data_center': { 'default': 'Auto', 'required': False, 'type': 'str'}, 'svc_type': { 'default': 'sig', @@ -203,6 +203,6 @@ 'type': 'str'}, 'vpn_id': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'dict'}} diff --git a/plugins/module_utils/feature_templates/cisco_snmp.py b/plugins/module_utils/feature_templates/cisco_snmp.py index 37957a9..4c253a0 100644 --- a/plugins/module_utils/feature_templates/cisco_snmp.py +++ b/plugins/module_utils/feature_templates/cisco_snmp.py @@ -13,7 +13,7 @@ 'required': False, 'type': 'list'}, 'contact': { 'default': None, - 'required': True, + 'required': False, 'type': 'str'}, 'group': { 'default': None, 'elements': 'dict', @@ -29,40 +29,40 @@ 'required': False, 'type': 'list'}, 'location': { 'default': None, - 'required': True, - 'type': 'str'}, - 'shutdown': { 'default': None, 'required': False, 'type': 'str'}, + 'shutdown': { 'default': True, + 'required': False, + 'type': 'bool'}, 'target': { 'default': None, 'elements': 'dict', 'options': { 'community_name': { 'default': None, - 'required': True, + 'required': False, 'type': 'str'}, 'ip': { 'default': None, 'required': True, 'type': 'str'}, 'port': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'source_interface': { 'default': None, - 'required': True, + 'required': False, 'type': 'str'}, 'user': { 'default': None, - 'required': True, + 'required': False, 'type': 'str'}, 'vpn_id': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'user': { 'default': None, 'elements': 'dict', 'options': { 'auth': { 'default': None, - 'required': True, + 'required': False, 'type': 'str'}, 'auth_password': { 'default': None, - 'required': True, + 'required': False, 'type': 'str'}, 'group': { 'default': None, 'required': True, @@ -74,7 +74,7 @@ 'required': True, 'type': 'str'}, 'priv_password': { 'default': None, - 'required': True, + 'required': False, 'type': 'str'}}, 'required': False, 'type': 'list'}, @@ -86,12 +86,12 @@ 'oid': { 'default': None, 'elements': 'dict', 'options': { 'exclude': { 'default': None, - 'required': True, - 'type': 'str'}, + 'required': False, + 'type': 'bool'}, 'id': { 'default': None, 'required': True, 'type': 'str'}}, - 'required': True, + 'required': False, 'type': 'list'}}, 'required': False, 'type': 'list'}}, diff --git a/plugins/module_utils/feature_templates/cisco_system.py b/plugins/module_utils/feature_templates/cisco_system.py index 7e67ea7..376bce9 100644 --- a/plugins/module_utils/feature_templates/cisco_system.py +++ b/plugins/module_utils/feature_templates/cisco_system.py @@ -1,7 +1,7 @@ cisco_system_definition = { 'cisco_system': { 'default': None, 'options': { 'admin_tech_on_failure': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'affinity_group_number': { 'default': None, 'required': False, 'type': 'str'}, @@ -31,23 +31,23 @@ 'type': 'list'}, 'enable_fencing': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enable_management_region': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enable_mrf_migration': { 'default': None, 'required': False, 'type': 'str'}, - 'enable_sms': { 'default': None, + 'enable_sms': { 'default': False, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enable_tunnel': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'epfr': { 'default': None, 'required': False, 'type': 'str'}, - 'hostname': { 'default': None, + 'hostname': { 'default': 'system_host_name', 'options': { 'name': { 'default': None, 'required': True, 'type': 'str'}}, @@ -67,7 +67,7 @@ 'type': 'str'}, 'management_gateway': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'max_omp_sessions': { 'default': None, 'required': False, 'type': 'str'}, @@ -83,7 +83,7 @@ 'type': 'list'}, 'multi_tenant': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'object_track': { 'default': None, 'elements': 'dict', 'options': { 'boolean': { 'default': None, @@ -95,25 +95,25 @@ 'ip': { 'default': None, 'required': True, 'type': 'str'}, - 'mask': { 'default': None, + 'mask': { 'default': '0.0.0.0', 'required': False, 'type': 'str'}, 'object': { 'default': None, 'elements': 'dict', 'options': { 'number': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': True, 'type': 'list'}, 'object_number': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'sig': { 'default': None, 'required': True, 'type': 'str'}, 'vpn': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'on_demand_idle_timeout_min': { 'default': None, @@ -124,7 +124,7 @@ 'type': 'str'}, 'port_hop': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'port_offset': { 'default': None, 'required': False, 'type': 'str'}, @@ -134,7 +134,7 @@ 'type': 'list'}, 'preference_auto': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'range': { 'default': None, 'required': False, 'type': 'str'}, @@ -147,14 +147,14 @@ 'secondary_region': { 'default': None, 'required': False, 'type': 'str'}, - 'site_id': { 'default': None, + 'site_id': { 'default': 'system_site_id', 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'site_type': { 'default': None, 'elements': 'str', 'required': False, 'type': 'list'}, - 'system_ip': { 'default': None, + 'system_ip': { 'default': 'system_system_ip', 'options': { 'name': { 'default': None, 'required': True, 'type': 'str'}}, @@ -165,13 +165,13 @@ 'type': 'str'}, 'track_default_gateway': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'track_interface_tag': { 'default': None, 'required': False, 'type': 'str'}, 'track_transport': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'tracker': { 'default': None, 'elements': 'dict', 'options': { 'boolean': { 'default': 'or', @@ -218,7 +218,7 @@ 'type': 'list'}, 'transport_gateway': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'vrf': { 'default': None, 'elements': 'dict', 'options': { 'gateway_preference': { 'default': None, @@ -227,7 +227,7 @@ 'type': 'list'}, 'vrf_id': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}}, 'required': False, diff --git a/plugins/module_utils/feature_templates/cisco_vpn.py b/plugins/module_utils/feature_templates/cisco_vpn.py index f6ae887..7536213 100644 --- a/plugins/module_utils/feature_templates/cisco_vpn.py +++ b/plugins/module_utils/feature_templates/cisco_vpn.py @@ -57,7 +57,7 @@ 'type': 'str'}, 'vpn': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'host': { 'default': None, @@ -82,7 +82,7 @@ 'type': 'str'}, 'vpn': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'ipv6_advertise': { 'default': None, @@ -122,7 +122,7 @@ 'type': 'str'}, 'name': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'overload': { 'default': 'true', 'required': False, 'type': 'str'}, @@ -187,13 +187,13 @@ 'type': 'str'}, 'source_port': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'translate_ip': { 'default': None, 'required': True, 'type': 'str'}, 'translate_port': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'route_export': { 'default': None, @@ -268,7 +268,7 @@ 'type': 'str'}, 'source_vpn': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'route_v4': { 'default': None, @@ -369,7 +369,7 @@ 'type': 'str'}, 'vpn': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'static': { 'default': None, @@ -395,7 +395,7 @@ 'elements': 'dict', 'options': { 'prefix_length': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'source_ip_subnet': { 'default': None, 'required': True, 'type': 'str'}, @@ -415,7 +415,7 @@ 'type': 'str'}, 'vpn_id': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'vpn_name': { 'default': None, 'required': False, 'type': 'str'}}, diff --git a/plugins/module_utils/feature_templates/cisco_vpn_interface.py b/plugins/module_utils/feature_templates/cisco_vpn_interface.py index 0568658..bcd7513 100644 --- a/plugins/module_utils/feature_templates/cisco_vpn_interface.py +++ b/plugins/module_utils/feature_templates/cisco_vpn_interface.py @@ -21,16 +21,16 @@ 'type': 'list'}, 'all': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'arp_timeout': { 'default': None, 'required': False, 'type': 'str'}, 'auto_bandwidth_detect': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'autonegotiate': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'bandwidth_down': { 'default': None, 'required': False, 'type': 'str'}, @@ -45,31 +45,31 @@ 'type': 'str'}, 'bgp': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'bind': { 'default': None, 'required': False, 'type': 'str'}, 'block_non_source_ip': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'border': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'carrier': { 'default': None, 'required': False, 'type': 'str'}, 'clear_dont_fragment': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'control_connections': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'core_region': { 'default': None, 'required': False, 'type': 'str'}, 'dhcp': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'dhcp_distance': { 'default': None, 'required': False, 'type': 'str'}, @@ -89,10 +89,10 @@ 'type': 'list'}, 'dhcp_ipv4_client': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'dhcp_ipv6_client': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'dmax': { 'default': None, 'required': False, 'type': 'str'}, @@ -101,7 +101,7 @@ 'type': 'str'}, 'dns': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'dst_ip': { 'default': None, 'required': False, 'type': 'str'}, @@ -110,19 +110,19 @@ 'type': 'str'}, 'enable': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enable_core_region': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enable_sgt_authorization_and_forwarding': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enable_sgt_enforcement': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enable_sgt_propagation': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'enforcement_sgt': { 'default': None, 'required': False, 'type': 'str'}, @@ -142,13 +142,13 @@ 'type': 'str'}, 'https': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'icmp': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'icmp_redirect_disable': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'if_name': { 'default': None, 'required': False, 'type': 'str'}, @@ -170,7 +170,7 @@ 'type': 'list'}, 'ip_directed_broadcast': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'iperf_server': { 'default': None, 'required': False, 'type': 'str'}, @@ -184,7 +184,7 @@ 'elements': 'dict', 'options': { 'grp_id': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'ipv6': { 'default': None, 'elements': 'dict', 'options': { 'ipv6_link_local': { 'default': None, @@ -197,10 +197,10 @@ 'type': 'list'}, 'priority': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'timer': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'track_omp': { 'default': None, 'required': False, 'type': 'bool'}, @@ -211,7 +211,7 @@ 'type': 'list'}, 'last_resort_circuit': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'load_interval': { 'default': None, 'required': False, 'type': 'str'}, @@ -220,7 +220,7 @@ 'type': 'str'}, 'low_bandwidth_link': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'mac_address': { 'default': None, 'required': False, 'type': 'str'}, @@ -238,13 +238,13 @@ 'type': 'str'}, 'nat': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'nat64': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'nat66': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'nat_choice': { 'default': None, 'required': False, 'type': 'str'}, @@ -259,43 +259,43 @@ 'type': 'str'}, 'netconf': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'network_broadcast': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'ntp': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'ospf': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'overload': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'per_tunnel_qos': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'per_tunnel_qos_aggregator': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'period': { 'default': None, 'required': False, 'type': 'str'}, 'poe': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'port_hop': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'prefix_length': { 'default': None, 'required': False, 'type': 'str'}, 'propagate_sgt': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'qos_adaptive': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'qos_map': { 'default': None, 'required': False, 'type': 'str'}, @@ -304,7 +304,7 @@ 'type': 'str'}, 'restrict': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'rule_name': { 'default': None, 'required': False, 'type': 'str'}, @@ -334,12 +334,12 @@ 'shaping_rate': { 'default': None, 'required': False, 'type': 'str'}, - 'shutdown': { 'default': None, + 'shutdown': { 'default': False, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'snmp': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'speed': { 'default': None, 'required': False, 'type': 'str'}, @@ -348,7 +348,7 @@ 'type': 'str'}, 'sshd': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'static': { 'default': None, 'elements': 'dict', 'options': { 'source_ip': { 'default': None, @@ -356,7 +356,7 @@ 'type': 'str'}, 'source_vpn': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'static_nat_direction': { 'default': 'inside', 'required': False, 'type': 'str'}, @@ -372,7 +372,7 @@ 'type': 'str'}, 'source_vpn_id': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'translated_source_prefix': { 'default': None, 'required': True, 'type': 'str'}}, @@ -388,10 +388,10 @@ 'type': 'str'}, 'source_port': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'source_vpn': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'static_nat_direction': { 'default': 'inside', 'required': False, 'type': 'str'}, @@ -400,12 +400,12 @@ 'type': 'str'}, 'translate_port': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'stun': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'tcp_mss_adjust': { 'default': None, 'required': False, 'type': 'str'}, @@ -422,7 +422,7 @@ 'type': 'str'}, 'weight': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'tloc_extension': { 'default': None, @@ -434,7 +434,7 @@ 'type': 'list'}, 'trusted': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'tunnel_tcp_mss_adjust': { 'default': None, 'required': False, 'type': 'str'}, @@ -455,7 +455,7 @@ 'type': 'str'}, 'vbond_as_stun_server': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'vmanage_connection_preference': { 'default': None, 'required': False, 'type': 'str'}, @@ -466,7 +466,7 @@ 'type': 'str'}, 'grp_id': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'ipv4_secondary': { 'default': None, 'elements': 'dict', 'options': { 'address': { 'default': None, @@ -476,10 +476,10 @@ 'type': 'list'}, 'priority': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'timer': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'int'}, 'tloc_change_pref': { 'default': None, 'required': False, 'type': 'bool'}, @@ -493,10 +493,10 @@ 'elements': 'dict', 'options': { 'decrement': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'name': { 'default': None, 'required': True, - 'type': 'str'}, + 'type': 'int'}, 'track_action': { 'default': 'Decrement', 'required': False, 'type': 'str'}}, @@ -504,7 +504,7 @@ 'type': 'list'}, 'value': { 'default': None, 'required': True, - 'type': 'str'}}, + 'type': 'int'}}, 'required': False, 'type': 'list'}, 'xconnect': { 'default': None, diff --git a/plugins/module_utils/feature_templates/omp_vsmart.py b/plugins/module_utils/feature_templates/omp_vsmart.py index ee29739..f44f841 100644 --- a/plugins/module_utils/feature_templates/omp_vsmart.py +++ b/plugins/module_utils/feature_templates/omp_vsmart.py @@ -4,16 +4,16 @@ 'type': 'str'}, 'affinity_group_preference': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'discard_rejected': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'eor_timer': { 'default': None, 'required': False, 'type': 'str'}, 'graceful_restart': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'graceful_restart_timer': { 'default': None, 'required': False, 'type': 'str'}, @@ -22,12 +22,12 @@ 'type': 'str'}, 'send_backup_paths': { 'default': None, 'required': False, - 'type': 'str'}, + 'type': 'bool'}, 'send_path_limit': { 'default': None, 'required': False, 'type': 'str'}, 'shutdown': { 'default': None, 'required': False, - 'type': 'str'}}, + 'type': 'bool'}}, 'required': False, 'type': 'dict'}} diff --git a/plugins/modules/feature_templates.py b/plugins/modules/feature_templates.py index b7e6af1..f3052d1 100644 --- a/plugins/modules/feature_templates.py +++ b/plugins/modules/feature_templates.py @@ -75,6 +75,8 @@ from ..module_utils.feature_templates.cisco_ntp import cisco_ntp_definition from ..module_utils.feature_templates.cisco_omp import cisco_omp_definition from ..module_utils.feature_templates.cisco_ospf import cisco_ospf_definition +from ..module_utils.feature_templates.cisco_system import cisco_system_definition + class ExtendedModuleResult(ModuleResult): templates_info: Optional[Dict] = Field(default={}) diff --git a/utils/ft_generator.py b/utils/ft_generator.py index 97e9b35..9a5fc3e 100644 --- a/utils/ft_generator.py +++ b/utils/ft_generator.py @@ -1,11 +1,12 @@ # Copyright 2024 Cisco Systems, Inc. and its affiliates # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import annotations import yaml from enum import Enum -from typing import Type, Union, get_args, get_origin +from typing import Annotated, Type, Union, get_args, get_origin, Literal from pathlib import Path, PurePath from pprint import pformat from jinja2 import Environment, FileSystemLoader @@ -13,6 +14,7 @@ from pydantic.fields import FieldInfo from catalystwan.api.templates.models.supported import available_models +from catalystwan.api.templates.device_variable import DeviceVariable from catalystwan.utils.device_model import DeviceModel PROJECT_ROOT_DIR = PurePath(Path.cwd()) @@ -32,23 +34,27 @@ def is_pydantic_model(type_): return False -def field_to_ansible_option(field: FieldInfo): - # # if field.description == "List of public keys for the user": - # if field.description == "A list of site types that are allowed to participate in the overlay network.": +def field_to_ansible_option(field: FieldInfo, field_name: str, model_name: str): + # if field.description == "List of public keys for the user": + # if field.description == "Configure Accounting Method": # from IPython import embed; embed() option = { "description": [field.description], "required": field.is_required(), "default": None, - "type": "str", # default type is str, will be overwritten as needed + "type": None # "str", #None, # default type is None, will be overwritten as needed } if not field.is_required(): if safe_issubclass(field.default, str) or safe_issubclass(field.default, str): option["default"] = field.default - if safe_issubclass(type(field.default), Enum): + elif safe_issubclass(type(field.default), Enum): option["default"] = field.default.value - if safe_issubclass(type(field.default), list): + elif safe_issubclass(type(field.default), str): option["default"] = field.default + elif safe_issubclass(type(field.default), list): + option["default"] = field.default + elif type(field.default) == DeviceVariable: + option["default"] = field.default.name field_type = get_origin(field.annotation) or field.annotation args = get_args(field.annotation) @@ -56,10 +62,13 @@ def field_to_ansible_option(field: FieldInfo): if field_type == bool: option["type"] = "bool" + + elif field_type == int: + option["type"] = "int" elif is_pydantic_model(field_type): option["type"] = "dict" - option["suboptions"] = model_to_ansible_options(field_type) + option["suboptions"] = model_to_ansible_options(field_type, model_name) elif field_type == list or (field_type == Union and list in subargs_base_types): elements_type = next((arg for arg in args if arg is not None), None) @@ -67,7 +76,7 @@ def field_to_ansible_option(field: FieldInfo): # from IPython import embed; embed() option["type"] = "list" option["elements"] = "dict" - option["suboptions"] = model_to_ansible_options(elements_type) + option["suboptions"] = model_to_ansible_options(elements_type, model_name) else: origin_type = get_origin(elements_type) if origin_type == list: @@ -77,28 +86,55 @@ def field_to_ansible_option(field: FieldInfo): if is_pydantic_model(user_class): option["type"] = "list" option["elements"] = "dict" - option["suboptions"] = model_to_ansible_options(user_class) + option["suboptions"] = model_to_ansible_options(user_class, model_name) elif safe_issubclass(user_class, Enum): option["type"] = "list" option["elements"] = "str" - option["choices"] = [item.value for item in user_class] + option["choices"] = [item.value for item in user_class] else: option["type"] = "list" option["elements"] = "str" elif is_pydantic_model(field_type): option["type"] = "dict" - option["suboptions"] = model_to_ansible_options(field_type) + option["suboptions"] = model_to_ansible_options(field_type, model_name) elif safe_issubclass(field_type, Enum): option["type"] = "str" option["choices"] = [item.value for item in field_type] elif field_type == Union and safe_issubclass(next((arg for arg in args if arg is not None), None), Enum): option["type"] = "str" option["choices"] = [item.value for item in args[0]] + elif field_type == Union and Annotated in subargs_base_types: + elements_type = next((arg for arg in args if arg is not None), None) + origin_type = get_origin(elements_type) + if origin_type == Annotated: + user_class = get_args(elements_type)[0] + else: + user_class = None + if user_class == bool: + option["type"] = "bool" + option["default"] = field.default + # from IPython import embed; embed() + # THIS LINE IS NEWEST FOR LITERALS + elif field_type == Union and Literal in subargs_base_types: + elements_type = next((arg for arg in args if arg is not None), None) + option["type"] = "str" + option["choices"] = [item for item in get_args(elements_type)] + elif field_type == Literal: + option["type"] = "str" + option["choices"] = [item for item in args] + else: + print(f"With model: {model_name}, field_name: {field_name} field: {field}") + option["type"] = "str" + if hasattr(field.default, "value"): + option["default"] = field.default.value + # from IPython import embed; embed() + # raise TypeError(f"Cannot properly create field from model: {model_name}, field_name: {field_name} field: {field}") + return option -def model_to_ansible_options(model: Type[BaseModel]): +def model_to_ansible_options(model: Type[BaseModel], model_name: str): options = {} for field_name, field in model.model_fields.items(): if field_name in [ @@ -108,7 +144,7 @@ def model_to_ansible_options(model: Type[BaseModel]): "device_specific_variables", ]: continue - options[field_name] = field_to_ansible_option(field) + options[field_name] = field_to_ansible_option(field, field_name, model_name) return options @@ -120,7 +156,7 @@ def generate_ansible_docs(model: Type[BaseModel], model_name: str): model_name: { "description": model._docs_description.default, "type": "dict", - "suboptions": model_to_ansible_options(model), + "suboptions": model_to_ansible_options(model, model_name), } } } @@ -181,8 +217,12 @@ def to_nice_yaml(data): template_file = PurePath("docs_fragments_template.j2") template = env.get_template(str(template_file)) - - output = template.render(yaml_data=ansible_docs) + try: + output = template.render(yaml_data=ansible_docs) + except Exception as ex: + print(ex) + print(ansible_docs) + raise ex filename = f"{PROJECT_ROOT_DIR}/plugins/doc_fragments/feature_template_{model_name}.py" with open(filename, "w") as f: