Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
===================================
Fortinet.Fortimanager Release Notes
===================================
.. contents:: Topics
v2.1.7
======
Release Summary
---------------
hotpath for backward-compatibility fix
Major Changes
-------------
- Fix compatibility issue for ansible 2.9.x and ansible-base 2.10.x.
- support Ansible changelogs.
v2.1.6
======
Release Summary
---------------
release fortinet.fortimanager to support FMG 7.2.x
Major Changes
-------------
- Many fixes for Ansible sanity test warnings & errors.
- Support FortiManager Schema 7.2.0 , 98 new modules
Minor Changes
-------------
- Best Practice Notes

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
{
"collection_info": {
"namespace": "fortinet",
"name": "fortimanager",
"version": "2.1.7",
"authors": [
"Link Zheng (@chillancezen)",
"Xue Jie (@JieX19)",
"Hongbin Lu (@fgtdev-hblu)",
"Frank Shen (@frankshen01)"
],
"readme": "README.md",
"tags": [
"fortinet",
"fortimanager",
"networking",
"security",
"cloud"
],
"description": "The FortiManager Ansible Collection.",
"license": [
"GPL-2.0-or-later"
],
"license_file": null,
"dependencies": {
"ansible.netcommon": "*"
},
"repository": "https://github.com/fortinet-ansible-dev/ansible-galaxy-fortimanager-collection/tree/galaxy/2.1.7",
"documentation": "https://ansible-galaxy-fortimanager-docs.readthedocs.io/en/galaxy-2.1.7",
"homepage": "https://fortinet.com",
"issues": "https://github.com/fortinet-ansible-dev/ansible-galaxy-fortimanager-collection/issues"
},
"file_manifest_file": {
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "feb800626054fe8f521f4a0b57956314d0c368c34a9ce8b86daf263cbea15de7",
"format": 1
},
"format": 1
}

View File

@@ -0,0 +1,901 @@
# Ansible Collection - fortinet.fortimanager:2.1.7
[Documentation](https://ansible-galaxy-fortimanager-docs.readthedocs.io/en/galaxy-2.1.7) for the collection.
## Modules
The collection provides the following modules:
* `fmgr_adom_options` no description.
* `fmgr_antivirus_mmschecksum` Configure MMS content checksum list.
* `fmgr_antivirus_mmschecksum_entries` modify this MMS content checksum list.
* `fmgr_antivirus_notification` Configure AntiVirus notification lists.
* `fmgr_antivirus_notification_entries` modify this antivirus notification list.
* `fmgr_antivirus_profile` Configure AntiVirus profiles.
* `fmgr_antivirus_profile_cifs` Configure CIFS AntiVirus options.
* `fmgr_antivirus_profile_contentdisarm` AV Content Disarm and Reconstruction settings.
* `fmgr_antivirus_profile_ftp` Configure FTP AntiVirus options.
* `fmgr_antivirus_profile_http` Configure HTTP AntiVirus options.
* `fmgr_antivirus_profile_imap` Configure IMAP AntiVirus options.
* `fmgr_antivirus_profile_mapi` Configure MAPI AntiVirus options.
* `fmgr_antivirus_profile_nacquar` Configure AntiVirus quarantine settings.
* `fmgr_antivirus_profile_nntp` Configure NNTP AntiVirus options.
* `fmgr_antivirus_profile_outbreakprevention` Configure Virus Outbreak Prevention settings.
* `fmgr_antivirus_profile_pop3` Configure POP3 AntiVirus options.
* `fmgr_antivirus_profile_smb` Configure SMB AntiVirus options.
* `fmgr_antivirus_profile_smtp` Configure SMTP AntiVirus options.
* `fmgr_antivirus_profile_ssh` Configure SFTP and SCP AntiVirus options.
* `fmgr_apcfgprofile` Configure AP local configuration profiles.
* `fmgr_apcfgprofile_commandlist` AP local configuration command list.
* `fmgr_application_categories` no description.
* `fmgr_application_custom` Configure custom application signatures.
* `fmgr_application_group` Configure firewall application groups.
* `fmgr_application_list` Configure application control lists.
* `fmgr_application_list_defaultnetworkservices` Default network service entries.
* `fmgr_application_list_entries` Application list entries.
* `fmgr_application_list_entries_parameters` Application parameters.
* `fmgr_application_list_entries_parameters_members` Parameter tuple members.
* `fmgr_authentication_scheme` Configure Authentication Schemes.
* `fmgr_bleprofile` Configure Bluetooth Low Energy profile.
* `fmgr_bonjourprofile` Configure Bonjour profiles.
* `fmgr_bonjourprofile_policylist` Bonjour policy list.
* `fmgr_certificate_template` no description.
* `fmgr_cifs_domaincontroller` Define known domain controller servers.
* `fmgr_cifs_profile` Configure CIFS profile.
* `fmgr_cifs_profile_filefilter` File filter.
* `fmgr_cifs_profile_filefilter_entries` File filter entries.
* `fmgr_cifs_profile_serverkeytab` Server keytab.
* `fmgr_clone` Clone an object in FortiManager.
* `fmgr_credentialstore_domaincontroller` Define known domain controller servers.
* `fmgr_devprof_device_profile_fortianalyzer` no description.
* `fmgr_devprof_device_profile_fortiguard` no description.
* `fmgr_devprof_import` no description.
* `fmgr_devprof_log_fortianalyzer_setting` Global FortiAnalyzer settings.
* `fmgr_devprof_log_fortianalyzercloud_setting` Global FortiAnalyzer Cloud settings.
* `fmgr_devprof_log_syslogd_filter` Filters for remote system server.
* `fmgr_devprof_log_syslogd_setting` Global settings for remote syslog server.
* `fmgr_devprof_system_centralmanagement` Configure central management.
* `fmgr_devprof_system_centralmanagement_serverlist` Additional severs that the FortiGate can use for updates (for AV, IPS, updates) and ratings (for web filter and antispam ratings) servers.
* `fmgr_devprof_system_dns` Configure DNS.
* `fmgr_devprof_system_emailserver` Configure the email server used by the FortiGate various things.
* `fmgr_devprof_system_global` Configure global attributes.
* `fmgr_devprof_system_ntp` Configure system NTP information.
* `fmgr_devprof_system_ntp_ntpserver` Configure the FortiGate to connect to any available third-party NTP server.
* `fmgr_devprof_system_replacemsg_admin` Replacement messages.
* `fmgr_devprof_system_replacemsg_alertmail` Replacement messages.
* `fmgr_devprof_system_replacemsg_auth` Replacement messages.
* `fmgr_devprof_system_replacemsg_devicedetectionportal` Replacement messages.
* `fmgr_devprof_system_replacemsg_ec` Replacement messages.
* `fmgr_devprof_system_replacemsg_fortiguardwf` Replacement messages.
* `fmgr_devprof_system_replacemsg_ftp` Replacement messages.
* `fmgr_devprof_system_replacemsg_http` Replacement messages.
* `fmgr_devprof_system_replacemsg_mail` Replacement messages.
* `fmgr_devprof_system_replacemsg_mms` Replacement messages.
* `fmgr_devprof_system_replacemsg_nacquar` Replacement messages.
* `fmgr_devprof_system_replacemsg_nntp` Replacement messages.
* `fmgr_devprof_system_replacemsg_spam` Replacement messages.
* `fmgr_devprof_system_replacemsg_sslvpn` Replacement messages.
* `fmgr_devprof_system_replacemsg_trafficquota` Replacement messages.
* `fmgr_devprof_system_replacemsg_utm` Replacement messages.
* `fmgr_devprof_system_replacemsg_webproxy` Replacement messages.
* `fmgr_devprof_system_snmp_community` SNMP community configuration.
* `fmgr_devprof_system_snmp_community_hosts` Configure IPv4 SNMP managers (hosts).
* `fmgr_devprof_system_snmp_community_hosts6` Configure IPv6 SNMP managers.
* `fmgr_devprof_system_snmp_sysinfo` SNMP system info configuration.
* `fmgr_devprof_system_snmp_user` SNMP user configuration.
* `fmgr_dlp_filepattern` Configure file patterns used by DLP blocking.
* `fmgr_dlp_filepattern_entries` Configure file patterns used by DLP blocking.
* `fmgr_dlp_fpsensitivity` Create self-explanatory DLP sensitivity levels to be used when setting sensitivity under config fp-doc-source.
* `fmgr_dlp_sensitivity` Create self-explanatory DLP sensitivity levels to be used when setting sensitivity under config fp-doc-source.
* `fmgr_dlp_sensor` Configure DLP sensors.
* `fmgr_dlp_sensor_filter` Set up DLP filters for this sensor.
* `fmgr_dnsfilter_domainfilter` Configure DNS domain filters.
* `fmgr_dnsfilter_domainfilter_entries` DNS domain filter entries.
* `fmgr_dnsfilter_profile` Configure DNS domain filter profiles.
* `fmgr_dnsfilter_profile_dnstranslation` DNS translation settings.
* `fmgr_dnsfilter_profile_domainfilter` Domain filter settings.
* `fmgr_dnsfilter_profile_ftgddns` FortiGuard DNS Filter settings.
* `fmgr_dnsfilter_profile_ftgddns_filters` FortiGuard DNS domain filters.
* `fmgr_dvm_cmd_add_device` Add a device to the Device Manager database.
* `fmgr_dvm_cmd_add_devlist` Add multiple devices to the Device Manager database.
* `fmgr_dvm_cmd_changehaseq` Modify HA sequence to promote a slave to become the master of the cluster.
* `fmgr_dvm_cmd_del_device` Delete a device.
* `fmgr_dvm_cmd_del_devlist` Delete a list of devices.
* `fmgr_dvm_cmd_discover_device` Probe a remote device and retrieve its device information and system status.
* `fmgr_dvm_cmd_import_devlist` Import a list of ADOMs and devices.
* `fmgr_dvm_cmd_reload_devlist` Retrieve a list of devices.
* `fmgr_dvm_cmd_update_device` Refresh the FGFM connection and system information of a device.
* `fmgr_dvm_cmd_update_devlist` Refresh FGFM connection and system information for a list of devices.
* `fmgr_dvmdb_adom` ADOM table, most attributes are read-only and can only be changed internally.
* `fmgr_dvmdb_adom_objectmember` ADOM table, most attributes are read-only and can only be changed internally.
* `fmgr_dvmdb_device` Device table, most attributes are read-only and can only be changed internally.
* `fmgr_dvmdb_device_replace_sn` Replace devices serial number with new value.
* `fmgr_dvmdb_device_vdom` Device VDOM table.
* `fmgr_dvmdb_folder` no description.
* `fmgr_dvmdb_group` Device group table.
* `fmgr_dvmdb_group_objectmember` Device group table.
* `fmgr_dvmdb_metafields_adom` no description.
* `fmgr_dvmdb_metafields_device` no description.
* `fmgr_dvmdb_metafields_group` no description.
* `fmgr_dvmdb_revision` ADOM revision table.
* `fmgr_dvmdb_script` Script table.
* `fmgr_dvmdb_script_execute` Run script.
* `fmgr_dvmdb_script_objectmember` Script table.
* `fmgr_dvmdb_script_scriptschedule` Script schedule table.
* `fmgr_dvmdb_workflow_approve` no description.
* `fmgr_dvmdb_workflow_discard` no description.
* `fmgr_dvmdb_workflow_drop` no description.
* `fmgr_dvmdb_workflow_reject` no description.
* `fmgr_dvmdb_workflow_repair` no description.
* `fmgr_dvmdb_workflow_revert` no description.
* `fmgr_dvmdb_workflow_review` no description.
* `fmgr_dvmdb_workflow_save` no description.
* `fmgr_dvmdb_workflow_start` Continue a workflow session.
* `fmgr_dvmdb_workflow_submit` no description.
* `fmgr_dvmdb_workspace_commit` Commit change(s) of an entire ADOM.
* `fmgr_dvmdb_workspace_commit_dev` Commit change(s) of a device.
* `fmgr_dvmdb_workspace_commit_obj` Commit change(s) of a specific object, where the url contains the full path to the object (eg.
* `fmgr_dvmdb_workspace_commit_pkg` Commit change(s) of a specific package, where the url includes both the folder(s) and name of the policy package.
* `fmgr_dvmdb_workspace_lock` Lock an entire ADOM.
* `fmgr_dvmdb_workspace_lock_dev` Lock a device.
* `fmgr_dvmdb_workspace_lock_obj` Lock a specific object, where the url contains the full path to the object (eg.
* `fmgr_dvmdb_workspace_lock_pkg` Lock a specific package, where the url includes both the folder(s) and name of the policy package.
* `fmgr_dvmdb_workspace_unlock` Unlock an entire ADOM.
* `fmgr_dvmdb_workspace_unlock_dev` Unlock a device.
* `fmgr_dvmdb_workspace_unlock_obj` Unlock a specific object, where the url contains the full path to the object (eg.
* `fmgr_dvmdb_workspace_unlock_pkg` Unlock a specific package, where the url includes both the folder(s) and name of the policy package.
* `fmgr_dynamic_address` no description.
* `fmgr_dynamic_address_dynamicaddrmapping` no description.
* `fmgr_dynamic_certificate_local` no description.
* `fmgr_dynamic_certificate_local_dynamicmapping` no description.
* `fmgr_dynamic_input_interface` no description.
* `fmgr_dynamic_input_interface_dynamicmapping` no description.
* `fmgr_dynamic_interface` no description.
* `fmgr_dynamic_interface_dynamicmapping` no description.
* `fmgr_dynamic_interface_platformmapping` no description.
* `fmgr_dynamic_ippool` no description.
* `fmgr_dynamic_multicast_interface` no description.
* `fmgr_dynamic_multicast_interface_dynamicmapping` no description.
* `fmgr_dynamic_vip` no description.
* `fmgr_dynamic_virtualwanlink_members` no description.
* `fmgr_dynamic_virtualwanlink_members_dynamicmapping` no description.
* `fmgr_dynamic_virtualwanlink_neighbor` no description.
* `fmgr_dynamic_virtualwanlink_neighbor_dynamicmapping` no description.
* `fmgr_dynamic_virtualwanlink_server` no description.
* `fmgr_dynamic_virtualwanlink_server_dynamicmapping` no description.
* `fmgr_dynamic_vpntunnel` no description.
* `fmgr_dynamic_vpntunnel_dynamicmapping` no description.
* `fmgr_emailfilter_blockallowlist` Configure anti-spam block/allow list.
* `fmgr_emailfilter_blockallowlist_entries` Anti-spam block/allow entries.
* `fmgr_emailfilter_bwl` Configure anti-spam black/white list.
* `fmgr_emailfilter_bwl_entries` Anti-spam black/white list entries.
* `fmgr_emailfilter_bword` Configure AntiSpam banned word list.
* `fmgr_emailfilter_bword_entries` Spam filter banned word.
* `fmgr_emailfilter_dnsbl` Configure AntiSpam DNSBL/ORBL.
* `fmgr_emailfilter_dnsbl_entries` Spam filter DNSBL and ORBL server.
* `fmgr_emailfilter_fortishield` Configure FortiGuard - AntiSpam.
* `fmgr_emailfilter_iptrust` Configure AntiSpam IP trust.
* `fmgr_emailfilter_iptrust_entries` Spam filter trusted IP addresses.
* `fmgr_emailfilter_mheader` Configure AntiSpam MIME header.
* `fmgr_emailfilter_mheader_entries` Spam filter mime header content.
* `fmgr_emailfilter_options` Configure AntiSpam options.
* `fmgr_emailfilter_profile` Configure Email Filter profiles.
* `fmgr_emailfilter_profile_filefilter` File filter.
* `fmgr_emailfilter_profile_filefilter_entries` File filter entries.
* `fmgr_emailfilter_profile_gmail` Gmail.
* `fmgr_emailfilter_profile_imap` IMAP.
* `fmgr_emailfilter_profile_mapi` MAPI.
* `fmgr_emailfilter_profile_msnhotmail` MSN Hotmail.
* `fmgr_emailfilter_profile_otherwebmails` Other supported webmails.
* `fmgr_emailfilter_profile_pop3` POP3.
* `fmgr_emailfilter_profile_smtp` SMTP.
* `fmgr_exec_fgfm_reclaimdevtunnel` Reclaim management tunnel to device.
* `fmgr_extendercontroller_dataplan` FortiExtender dataplan configuration.
* `fmgr_extendercontroller_simprofile` no description.
* `fmgr_extendercontroller_simprofile_autoswitchprofile` no description.
* `fmgr_extendercontroller_template` no description.
* `fmgr_fact` Gather fortimanager facts.
* `fmgr_filefilter_profile` Configure file-filter profiles.
* `fmgr_filefilter_profile_rules` File filter rules.
* `fmgr_firewall_accessproxy` Configure Access Proxy.
* `fmgr_firewall_accessproxy_apigateway` Set API Gateway.
* `fmgr_firewall_accessproxy_apigateway_realservers` Select the real servers that this Access Proxy will distribute traffic to.
* `fmgr_firewall_accessproxy_apigateway_sslciphersuites` SSL/TLS cipher suites to offer to a server, ordered by priority.
* `fmgr_firewall_accessproxy_realservers` Select the SSL real servers that this Access Proxy will distribute traffic to.
* `fmgr_firewall_accessproxy_serverpubkeyauthsettings` Server SSH public key authentication settings.
* `fmgr_firewall_accessproxy_serverpubkeyauthsettings_certextension` Configure certificate extension for user certificate.
* `fmgr_firewall_address` Configure IPv4 addresses.
* `fmgr_firewall_address6` Configure IPv6 firewall addresses.
* `fmgr_firewall_address6_dynamicmapping` Configure IPv6 firewall addresses.
* `fmgr_firewall_address6_dynamicmapping_subnetsegment` IPv6 subnet segments.
* `fmgr_firewall_address6_list` IP address list.
* `fmgr_firewall_address6_subnetsegment` IPv6 subnet segments.
* `fmgr_firewall_address6_tagging` Config object tagging.
* `fmgr_firewall_address6template` Configure IPv6 address templates.
* `fmgr_firewall_address6template_subnetsegment` IPv6 subnet segments.
* `fmgr_firewall_address6template_subnetsegment_values` Subnet segment values.
* `fmgr_firewall_address_dynamicmapping` Configure IPv4 addresses.
* `fmgr_firewall_address_list` IP address list.
* `fmgr_firewall_address_tagging` Config object tagging.
* `fmgr_firewall_addrgrp` Configure IPv4 address groups.
* `fmgr_firewall_addrgrp6` Configure IPv6 address groups.
* `fmgr_firewall_addrgrp6_dynamicmapping` Configure IPv6 address groups.
* `fmgr_firewall_addrgrp6_tagging` Config object tagging.
* `fmgr_firewall_addrgrp_dynamicmapping` Configure IPv4 address groups.
* `fmgr_firewall_addrgrp_tagging` Config object tagging.
* `fmgr_firewall_carrierendpointbwl` Carrier end point black/white list tables.
* `fmgr_firewall_carrierendpointbwl_entries` Carrier end point black/white list.
* `fmgr_firewall_decryptedtrafficmirror` Configure decrypted traffic mirror.
* `fmgr_firewall_gtp` Configure GTP.
* `fmgr_firewall_gtp_apn` APN.
* `fmgr_firewall_gtp_ieremovepolicy` IE remove policy.
* `fmgr_firewall_gtp_ievalidation` IE validation.
* `fmgr_firewall_gtp_imsi` IMSI.
* `fmgr_firewall_gtp_ippolicy` IP policy.
* `fmgr_firewall_gtp_messageratelimit` Message rate limiting.
* `fmgr_firewall_gtp_messageratelimitv0` Message rate limiting for GTP version 0.
* `fmgr_firewall_gtp_messageratelimitv1` Message rate limiting for GTP version 1.
* `fmgr_firewall_gtp_messageratelimitv2` Message rate limiting for GTP version 2.
* `fmgr_firewall_gtp_noippolicy` No IP policy.
* `fmgr_firewall_gtp_perapnshaper` Per APN shaper.
* `fmgr_firewall_gtp_policy` Policy.
* `fmgr_firewall_gtp_policyv2` Apply allow or deny action to each GTPv2-c packet.
* `fmgr_firewall_identitybasedroute` Configure identity based routing.
* `fmgr_firewall_identitybasedroute_rule` Rule.
* `fmgr_firewall_internetservice` Show Internet Service application.
* `fmgr_firewall_internetservice_entry` Entries in the Internet Service database.
* `fmgr_firewall_internetserviceaddition` Configure Internet Services Addition.
* `fmgr_firewall_internetserviceaddition_entry` Entries added to the Internet Service addition database.
* `fmgr_firewall_internetserviceaddition_entry_portrange` Port ranges in the custom entry.
* `fmgr_firewall_internetservicecustom` Configure custom Internet Services.
* `fmgr_firewall_internetservicecustom_disableentry` Disable entries in the Internet Service database.
* `fmgr_firewall_internetservicecustom_disableentry_iprange` IP ranges in the disable entry.
* `fmgr_firewall_internetservicecustom_entry` Entries added to the Internet Service database and custom database.
* `fmgr_firewall_internetservicecustom_entry_portrange` Port ranges in the custom entry.
* `fmgr_firewall_internetservicecustomgroup` Configure custom Internet Service group.
* `fmgr_firewall_internetservicegroup` Configure group of Internet Service.
* `fmgr_firewall_internetservicename` Define internet service names.
* `fmgr_firewall_ippool` Configure IPv4 IP pools.
* `fmgr_firewall_ippool6` Configure IPv6 IP pools.
* `fmgr_firewall_ippool6_dynamicmapping` Configure IPv6 IP pools.
* `fmgr_firewall_ippool_dynamicmapping` Configure IPv4 IP pools.
* `fmgr_firewall_ldbmonitor` Configure server load balancing health monitors.
* `fmgr_firewall_mmsprofile` Configure MMS profiles.
* `fmgr_firewall_mmsprofile_dupe` Duplicate configuration.
* `fmgr_firewall_mmsprofile_flood` Flood configuration.
* `fmgr_firewall_mmsprofile_notification` Notification configuration.
* `fmgr_firewall_mmsprofile_notifmsisdn` Notification for MSISDNs.
* `fmgr_firewall_mmsprofile_outbreakprevention` Configure Virus Outbreak Prevention settings.
* `fmgr_firewall_multicastaddress` Configure multicast addresses.
* `fmgr_firewall_multicastaddress6` Configure IPv6 multicast address.
* `fmgr_firewall_multicastaddress6_tagging` Config object tagging.
* `fmgr_firewall_multicastaddress_tagging` Config object tagging.
* `fmgr_firewall_profilegroup` Configure profile groups.
* `fmgr_firewall_profileprotocoloptions` Configure protocol options.
* `fmgr_firewall_profileprotocoloptions_cifs` Configure CIFS protocol options.
* `fmgr_firewall_profileprotocoloptions_cifs_filefilter` File filter.
* `fmgr_firewall_profileprotocoloptions_cifs_filefilter_entries` File filter entries.
* `fmgr_firewall_profileprotocoloptions_cifs_serverkeytab` Server keytab.
* `fmgr_firewall_profileprotocoloptions_dns` Configure DNS protocol options.
* `fmgr_firewall_profileprotocoloptions_ftp` Configure FTP protocol options.
* `fmgr_firewall_profileprotocoloptions_http` Configure HTTP protocol options.
* `fmgr_firewall_profileprotocoloptions_imap` Configure IMAP protocol options.
* `fmgr_firewall_profileprotocoloptions_mailsignature` Configure Mail signature.
* `fmgr_firewall_profileprotocoloptions_mapi` Configure MAPI protocol options.
* `fmgr_firewall_profileprotocoloptions_nntp` Configure NNTP protocol options.
* `fmgr_firewall_profileprotocoloptions_pop3` Configure POP3 protocol options.
* `fmgr_firewall_profileprotocoloptions_smtp` Configure SMTP protocol options.
* `fmgr_firewall_profileprotocoloptions_ssh` Configure SFTP and SCP protocol options.
* `fmgr_firewall_proxyaddress` Web proxy address configuration.
* `fmgr_firewall_proxyaddress_headergroup` HTTP header group.
* `fmgr_firewall_proxyaddress_tagging` Config object tagging.
* `fmgr_firewall_proxyaddrgrp` Web proxy address group configuration.
* `fmgr_firewall_proxyaddrgrp_tagging` Config object tagging.
* `fmgr_firewall_schedule_group` Schedule group configuration.
* `fmgr_firewall_schedule_onetime` Onetime schedule configuration.
* `fmgr_firewall_schedule_recurring` Recurring schedule configuration.
* `fmgr_firewall_service_category` Configure service categories.
* `fmgr_firewall_service_custom` Configure custom services.
* `fmgr_firewall_service_group` Configure service groups.
* `fmgr_firewall_shaper_peripshaper` Configure per-IP traffic shaper.
* `fmgr_firewall_shaper_trafficshaper` Configure shared traffic shaper.
* `fmgr_firewall_shapingprofile` Configure shaping profiles.
* `fmgr_firewall_shapingprofile_shapingentries` Define shaping entries of this shaping profile.
* `fmgr_firewall_ssh_localca` SSH proxy local CA.
* `fmgr_firewall_sslsshprofile` Configure SSL/SSH protocol options.
* `fmgr_firewall_sslsshprofile_dot` Configure DNS over TLS options.
* `fmgr_firewall_sslsshprofile_ftps` Configure FTPS options.
* `fmgr_firewall_sslsshprofile_https` Configure HTTPS options.
* `fmgr_firewall_sslsshprofile_imaps` Configure IMAPS options.
* `fmgr_firewall_sslsshprofile_pop3s` Configure POP3S options.
* `fmgr_firewall_sslsshprofile_smtps` Configure SMTPS options.
* `fmgr_firewall_sslsshprofile_ssh` Configure SSH options.
* `fmgr_firewall_sslsshprofile_ssl` Configure SSL options.
* `fmgr_firewall_sslsshprofile_sslexempt` Servers to exempt from SSL inspection.
* `fmgr_firewall_sslsshprofile_sslserver` SSL servers.
* `fmgr_firewall_trafficclass` Configure names for shaping classes.
* `fmgr_firewall_vip` Configure virtual IP for IPv4.
* `fmgr_firewall_vip46` Configure IPv4 to IPv6 virtual IPs.
* `fmgr_firewall_vip46_dynamicmapping` Configure IPv4 to IPv6 virtual IPs.
* `fmgr_firewall_vip46_realservers` Real servers.
* `fmgr_firewall_vip6` Configure virtual IP for IPv6.
* `fmgr_firewall_vip64` Configure IPv6 to IPv4 virtual IPs.
* `fmgr_firewall_vip64_dynamicmapping` Configure IPv6 to IPv4 virtual IPs.
* `fmgr_firewall_vip64_realservers` Real servers.
* `fmgr_firewall_vip6_dynamicmapping` Configure virtual IP for IPv6.
* `fmgr_firewall_vip6_realservers` Select the real servers that this server load balancing VIP will distribute traffic to.
* `fmgr_firewall_vip6_sslciphersuites` SSL/TLS cipher suites acceptable from a client, ordered by priority.
* `fmgr_firewall_vip6_sslserverciphersuites` SSL/TLS cipher suites to offer to a server, ordered by priority.
* `fmgr_firewall_vip_dynamicmapping` Configure virtual IP for IPv4.
* `fmgr_firewall_vip_dynamicmapping_realservers` Select the real servers that this server load balancing VIP will distribute traffic to.
* `fmgr_firewall_vip_dynamicmapping_sslciphersuites` SSL/TLS cipher suites acceptable from a client, ordered by priority.
* `fmgr_firewall_vip_realservers` Select the real servers that this server load balancing VIP will distribute traffic to.
* `fmgr_firewall_vip_sslciphersuites` SSL/TLS cipher suites acceptable from a client, ordered by priority.
* `fmgr_firewall_vip_sslserverciphersuites` SSL/TLS cipher suites to offer to a server, ordered by priority.
* `fmgr_firewall_vipgrp` Configure IPv4 virtual IP groups.
* `fmgr_firewall_vipgrp46` Configure IPv4 to IPv6 virtual IP groups.
* `fmgr_firewall_vipgrp6` Configure IPv6 virtual IP groups.
* `fmgr_firewall_vipgrp64` Configure IPv6 to IPv4 virtual IP groups.
* `fmgr_firewall_vipgrp_dynamicmapping` Configure IPv4 virtual IP groups.
* `fmgr_firewall_wildcardfqdn_custom` Config global/VDOM Wildcard FQDN address.
* `fmgr_firewall_wildcardfqdn_group` Config global Wildcard FQDN address groups.
* `fmgr_fmupdate_analyzer_virusreport` Send virus detection notification to FortiGuard.
* `fmgr_fmupdate_avips_advancedlog` Enable/disable logging of FortiGuard antivirus and IPS update packages received by FortiManagers built-in FortiGuard.
* `fmgr_fmupdate_avips_webproxy` Configure the web proxy for use with FortiGuard antivirus and IPS updates.
* `fmgr_fmupdate_customurllist` Configure the URL database for rating and filtering.
* `fmgr_fmupdate_diskquota` Configure disk space available for use by the Upgrade Manager.
* `fmgr_fmupdate_fctservices` Configure FortiGuard to provide services to FortiClient installations.
* `fmgr_fmupdate_fdssetting` Configure FortiGuard settings.
* `fmgr_fmupdate_fdssetting_pushoverride` Enable/disable push updates, and override the default IP address and port used by FortiGuard to send antivirus and IPS push messages for.
* `fmgr_fmupdate_fdssetting_pushoverridetoclient` Enable/disable push updates, and override the default IP address and port used by FortiGuard to send antivirus and IPS push messages for.
* `fmgr_fmupdate_fdssetting_pushoverridetoclient_announceip` Announce IP addresses for the device.
* `fmgr_fmupdate_fdssetting_serveroverride` Server override configure.
* `fmgr_fmupdate_fdssetting_serveroverride_servlist` Override server.
* `fmgr_fmupdate_fdssetting_updateschedule` Configure the schedule when built-in FortiGuard retrieves antivirus and IPS updates.
* `fmgr_fmupdate_fwmsetting` Configure firmware management settings.
* `fmgr_fmupdate_multilayer` Configure multilayer mode.
* `fmgr_fmupdate_publicnetwork` Enable/disable access to the public FortiGuard.
* `fmgr_fmupdate_serveraccesspriorities` Configure priorities for FortiGate units accessing antivirus updates and web filtering services.
* `fmgr_fmupdate_serveraccesspriorities_privateserver` Configure multiple FortiManager units and private servers.
* `fmgr_fmupdate_serveroverridestatus` Configure strict/loose server override.
* `fmgr_fmupdate_service` Enable/disable services provided by the built-in FortiGuard.
* `fmgr_fmupdate_webspam_fgdsetting` Configure the FortiGuard run parameters.
* `fmgr_fmupdate_webspam_fgdsetting_serveroverride` Server override configure.
* `fmgr_fmupdate_webspam_fgdsetting_serveroverride_servlist` Override server.
* `fmgr_fmupdate_webspam_webproxy` Configure the web proxy for use with FortiGuard antivirus and IPS updates.
* `fmgr_fsp_vlan` no description.
* `fmgr_fsp_vlan_dhcpserver` Configure DHCP servers.
* `fmgr_fsp_vlan_dhcpserver_excluderange` Exclude one or more ranges of IP addresses from being assigned to clients.
* `fmgr_fsp_vlan_dhcpserver_iprange` DHCP IP range configuration.
* `fmgr_fsp_vlan_dhcpserver_options` DHCP options.
* `fmgr_fsp_vlan_dhcpserver_reservedaddress` Options for the DHCP server to assign IP settings to specific MAC addresses.
* `fmgr_fsp_vlan_dynamicmapping` no description.
* `fmgr_fsp_vlan_dynamicmapping_dhcpserver` Configure DHCP servers.
* `fmgr_fsp_vlan_dynamicmapping_dhcpserver_excluderange` Exclude one or more ranges of IP addresses from being assigned to clients.
* `fmgr_fsp_vlan_dynamicmapping_dhcpserver_iprange` DHCP IP range configuration.
* `fmgr_fsp_vlan_dynamicmapping_dhcpserver_options` DHCP options.
* `fmgr_fsp_vlan_dynamicmapping_dhcpserver_reservedaddress` Options for the DHCP server to assign IP settings to specific MAC addresses.
* `fmgr_fsp_vlan_dynamicmapping_interface` no description.
* `fmgr_fsp_vlan_dynamicmapping_interface_ipv6` IPv6 of interface.
* `fmgr_fsp_vlan_dynamicmapping_interface_ipv6_ip6delegatedprefixlist` Advertised IPv6 delegated prefix list.
* `fmgr_fsp_vlan_dynamicmapping_interface_ipv6_ip6extraaddr` Extra IPv6 address prefixes of interface.
* `fmgr_fsp_vlan_dynamicmapping_interface_ipv6_ip6prefixlist` Advertised prefix list.
* `fmgr_fsp_vlan_dynamicmapping_interface_ipv6_vrrp6` IPv6 VRRP configuration.
* `fmgr_fsp_vlan_dynamicmapping_interface_secondaryip` Second IP address of interface.
* `fmgr_fsp_vlan_interface` Configure interfaces.
* `fmgr_fsp_vlan_interface_ipv6` IPv6 of interface.
* `fmgr_fsp_vlan_interface_ipv6_ip6delegatedprefixlist` Advertised IPv6 delegated prefix list.
* `fmgr_fsp_vlan_interface_ipv6_ip6extraaddr` Extra IPv6 address prefixes of interface.
* `fmgr_fsp_vlan_interface_ipv6_ip6prefixlist` Advertised prefix list.
* `fmgr_fsp_vlan_interface_ipv6_vrrp6` IPv6 VRRP configuration.
* `fmgr_fsp_vlan_interface_secondaryip` Second IP address of interface.
* `fmgr_fsp_vlan_interface_vrrp` VRRP configuration.
* `fmgr_generic` Build and send generic FortiManager API request.
* `fmgr_gtp_apn` Configure APN for GTP.
* `fmgr_gtp_apngrp` Configure APN groups for GTP.
* `fmgr_gtp_iewhitelist` IE white list.
* `fmgr_gtp_iewhitelist_entries` Entries of white list (to allow) for unknown or out-of-state IEs.
* `fmgr_gtp_messagefilterv0v1` Message filter for GTPv0/v1 messages.
* `fmgr_gtp_messagefilterv2` Message filter for GTPv2 messages.
* `fmgr_gtp_tunnellimit` GTP tunnel limiter.
* `fmgr_hotspot20_anqp3gppcellular` Configure 3GPP public land mobile network (PLMN).
* `fmgr_hotspot20_anqp3gppcellular_mccmnclist` Mobile Country Code and Mobile Network Code configuration.
* `fmgr_hotspot20_anqpipaddresstype` Configure IP address type availability.
* `fmgr_hotspot20_anqpnairealm` Configure network access identifier (NAI) realm.
* `fmgr_hotspot20_anqpnairealm_nailist` NAI list.
* `fmgr_hotspot20_anqpnairealm_nailist_eapmethod` EAP Methods.
* `fmgr_hotspot20_anqpnairealm_nailist_eapmethod_authparam` EAP auth param.
* `fmgr_hotspot20_anqpnetworkauthtype` Configure network authentication type.
* `fmgr_hotspot20_anqproamingconsortium` Configure roaming consortium.
* `fmgr_hotspot20_anqproamingconsortium_oilist` Organization identifier list.
* `fmgr_hotspot20_anqpvenuename` Configure venue name duple.
* `fmgr_hotspot20_anqpvenuename_valuelist` Name list.
* `fmgr_hotspot20_h2qpconncapability` Configure connection capability.
* `fmgr_hotspot20_h2qpoperatorname` Configure operator friendly name.
* `fmgr_hotspot20_h2qpoperatorname_valuelist` Name list.
* `fmgr_hotspot20_h2qposuprovider` Configure online sign up (OSU) provider list.
* `fmgr_hotspot20_h2qposuprovider_friendlyname` OSU provider friendly name.
* `fmgr_hotspot20_h2qposuprovider_servicedescription` OSU service name.
* `fmgr_hotspot20_h2qpwanmetric` Configure WAN metrics.
* `fmgr_hotspot20_hsprofile` Configure hotspot profile.
* `fmgr_hotspot20_qosmap` Configure QoS map set.
* `fmgr_hotspot20_qosmap_dscpexcept` Differentiated Services Code Point (DSCP) exceptions.
* `fmgr_hotspot20_qosmap_dscprange` Differentiated Services Code Point (DSCP) ranges.
* `fmgr_icap_profile` Configure ICAP profiles.
* `fmgr_icap_profile_icapheaders` Configure ICAP forwarded request headers.
* `fmgr_icap_profile_respmodforwardrules` ICAP response mode forward rules.
* `fmgr_icap_profile_respmodforwardrules_headergroup` HTTP header group.
* `fmgr_icap_server` Configure ICAP servers.
* `fmgr_ips_custom` Configure IPS custom signature.
* `fmgr_ips_sensor` Configure IPS sensor.
* `fmgr_ips_sensor_entries` IPS sensor filter.
* `fmgr_ips_sensor_entries_exemptip` Traffic from selected source or destination IP addresses is exempt from this signature.
* `fmgr_log_customfield` Configure custom log fields.
* `fmgr_metafields_system_admin_user` no description.
* `fmgr_move` Move fortimanager defined Object.
* `fmgr_mpskprofile` Configure MPSK profile.
* `fmgr_mpskprofile_mpskgroup` List of multiple PSK groups.
* `fmgr_mpskprofile_mpskgroup_mpskkey` List of multiple PSK entries.
* `fmgr_pkg_authentication_rule` Configure Authentication Rules.
* `fmgr_pkg_authentication_setting` Configure authentication setting.
* `fmgr_pkg_central_dnat` no description.
* `fmgr_pkg_central_dnat6` no description.
* `fmgr_pkg_firewall_centralsnatmap` Configure central SNAT policies.
* `fmgr_pkg_firewall_consolidated_policy` Configure consolidated IPv4/IPv6 policies.
* `fmgr_pkg_firewall_consolidated_policy_sectionvalue` Configure consolidated IPv4/IPv6 policies.
* `fmgr_pkg_firewall_dospolicy` Configure IPv4 DoS policies.
* `fmgr_pkg_firewall_dospolicy6` Configure IPv6 DoS policies.
* `fmgr_pkg_firewall_dospolicy6_anomaly` Anomaly name.
* `fmgr_pkg_firewall_dospolicy_anomaly` Anomaly name.
* `fmgr_pkg_firewall_interfacepolicy` Configure IPv4 interface policies.
* `fmgr_pkg_firewall_interfacepolicy6` Configure IPv6 interface policies.
* `fmgr_pkg_firewall_interfacepolicy6_sectionvalue` Configure IPv6 interface policies.
* `fmgr_pkg_firewall_interfacepolicy_sectionvalue` Configure IPv4 interface policies.
* `fmgr_pkg_firewall_localinpolicy` Configure user defined IPv4 local-in policies.
* `fmgr_pkg_firewall_localinpolicy6` Configure user defined IPv6 local-in policies.
* `fmgr_pkg_firewall_multicastpolicy` Configure multicast NAT policies.
* `fmgr_pkg_firewall_multicastpolicy6` Configure IPv6 multicast NAT policies.
* `fmgr_pkg_firewall_policy` Configure IPv4 policies.
* `fmgr_pkg_firewall_policy46` Configure IPv4 to IPv6 policies.
* `fmgr_pkg_firewall_policy6` Configure IPv6 policies.
* `fmgr_pkg_firewall_policy64` Configure IPv6 to IPv4 policies.
* `fmgr_pkg_firewall_policy6_sectionvalue` Configure IPv6 policies.
* `fmgr_pkg_firewall_policy_sectionvalue` Configure IPv4 policies.
* `fmgr_pkg_firewall_policy_vpndstnode` no description.
* `fmgr_pkg_firewall_policy_vpnsrcnode` no description.
* `fmgr_pkg_firewall_proxypolicy` Configure proxy policies.
* `fmgr_pkg_firewall_proxypolicy_sectionvalue` Configure proxy policies.
* `fmgr_pkg_firewall_securitypolicy` Configure NGFW IPv4/IPv6 application policies.
* `fmgr_pkg_firewall_securitypolicy_sectionvalue` Configure NGFW IPv4/IPv6 application policies.
* `fmgr_pkg_firewall_shapingpolicy` Configure shaping policies.
* `fmgr_pkg_footer_policy` Configure IPv4/IPv6 policies.
* `fmgr_pkg_footer_policy6` Configure IPv6 policies.
* `fmgr_pkg_footer_shapingpolicy` Configure shaping policies.
* `fmgr_pkg_header_policy` Configure IPv4/IPv6 policies.
* `fmgr_pkg_header_policy6` Configure IPv6 policies.
* `fmgr_pkg_header_shapingpolicy` Configure shaping policies.
* `fmgr_pm_config_metafields_firewall_address` no description.
* `fmgr_pm_config_metafields_firewall_addrgrp` no description.
* `fmgr_pm_config_metafields_firewall_centralsnatmap` no description.
* `fmgr_pm_config_metafields_firewall_policy` no description.
* `fmgr_pm_config_metafields_firewall_service_custom` no description.
* `fmgr_pm_config_metafields_firewall_service_group` no description.
* `fmgr_pm_config_reset_database` Reset Global ADOM to a specific version.
* `fmgr_pm_config_upgrade` Upgrade an ADOM to the next version.
* `fmgr_pm_config_workspace_commit` Commit changes to an ADOM.
* `fmgr_pm_config_workspace_lock` Lock an ADOM in workspace mode.
* `fmgr_pm_config_workspace_unlock` Unlock an ADOM.
* `fmgr_pm_devprof_adom` no description.
* `fmgr_pm_devprof_pkg` no description.
* `fmgr_pm_pkg` no description.
* `fmgr_pm_pkg_adom` no description.
* `fmgr_pm_pkg_global` no description.
* `fmgr_pm_wanprof_adom` no description.
* `fmgr_pm_wanprof_pkg` no description.
* `fmgr_qosprofile` Configure WiFi quality of service (QoS) profiles.
* `fmgr_region` Configure FortiAP regions (for floor plans and maps).
* `fmgr_securityconsole_abort` Abort and cancel a security console task.
* `fmgr_securityconsole_assign_package` Assign or unassign global policy package to ADOM packages.
* `fmgr_securityconsole_import_dev_objs` Import objects from device to ADOM, or from ADOM to Global.
* `fmgr_securityconsole_install_device` no description.
* `fmgr_securityconsole_install_package` Copy and install a policy package to devices.
* `fmgr_securityconsole_install_preview` Generate install preview for a device.
* `fmgr_securityconsole_package_cancel_install` Cancel policy install and clear preview cache.
* `fmgr_securityconsole_package_clone` Clone a policy package within the same ADOM.
* `fmgr_securityconsole_package_commit` Install policies to device from preview cache.
* `fmgr_securityconsole_package_move` Move and/or rename a policy package within the same ADOM.
* `fmgr_securityconsole_pblock_clone` no description.
* `fmgr_securityconsole_preview_result` Retrieve the result of previous install/preview command.
* `fmgr_securityconsole_reinstall_package` Re-install a policy package that had been previously installed.
* `fmgr_securityconsole_sign_certificate_template` Generate and sign certificate on the target device.
* `fmgr_spamfilter_bwl` Configure anti-spam black/white list.
* `fmgr_spamfilter_bwl_entries` Anti-spam black/white list entries.
* `fmgr_spamfilter_bword` Configure AntiSpam banned word list.
* `fmgr_spamfilter_bword_entries` Spam filter banned word.
* `fmgr_spamfilter_dnsbl` Configure AntiSpam DNSBL/ORBL.
* `fmgr_spamfilter_dnsbl_entries` Spam filter DNSBL and ORBL server.
* `fmgr_spamfilter_iptrust` Configure AntiSpam IP trust.
* `fmgr_spamfilter_iptrust_entries` Spam filter trusted IP addresses.
* `fmgr_spamfilter_mheader` Configure AntiSpam MIME header.
* `fmgr_spamfilter_mheader_entries` Spam filter mime header content.
* `fmgr_spamfilter_profile` Configure AntiSpam profiles.
* `fmgr_spamfilter_profile_gmail` Gmail.
* `fmgr_spamfilter_profile_imap` IMAP.
* `fmgr_spamfilter_profile_mapi` MAPI.
* `fmgr_spamfilter_profile_msnhotmail` MSN Hotmail.
* `fmgr_spamfilter_profile_pop3` POP3.
* `fmgr_spamfilter_profile_smtp` SMTP.
* `fmgr_spamfilter_profile_yahoomail` Yahoo! Mail.
* `fmgr_sshfilter_profile` SSH filter profile.
* `fmgr_sshfilter_profile_filefilter` File filter.
* `fmgr_sshfilter_profile_filefilter_entries` File filter entries.
* `fmgr_sshfilter_profile_shellcommands` SSH command filter.
* `fmgr_switchcontroller_customcommand` Configure the FortiGate switch controller to send custom commands to managed FortiSwitch devices.
* `fmgr_switchcontroller_lldpprofile` Configure FortiSwitch LLDP profiles.
* `fmgr_switchcontroller_lldpprofile_customtlvs` Configuration method to edit custom TLV entries.
* `fmgr_switchcontroller_lldpprofile_medlocationservice` Configuration method to edit Media Endpoint Discovery (MED) location service type-length-value (TLV) categories.
* `fmgr_switchcontroller_lldpprofile_mednetworkpolicy` Configuration method to edit Media Endpoint Discovery (MED) network policy type-length-value (TLV) categories.
* `fmgr_switchcontroller_managedswitch` Configure FortiSwitch devices that are managed by this FortiGate.
* `fmgr_switchcontroller_managedswitch_8021xsettings` Configuration method to edit FortiSwitch 802.
* `fmgr_switchcontroller_managedswitch_customcommand` Configuration method to edit FortiSwitch commands to be pushed to this FortiSwitch device upon rebooting the FortiGate switch controller.
* `fmgr_switchcontroller_managedswitch_igmpsnooping` Configure FortiSwitch IGMP snooping global settings.
* `fmgr_switchcontroller_managedswitch_ipsourceguard` IP source guard.
* `fmgr_switchcontroller_managedswitch_ipsourceguard_bindingentry` IP and MAC address configuration.
* `fmgr_switchcontroller_managedswitch_mirror` Configuration method to edit FortiSwitch packet mirror.
* `fmgr_switchcontroller_managedswitch_ports` Managed-switch port list.
* `fmgr_switchcontroller_managedswitch_remotelog` Configure logging by FortiSwitch device to a remote syslog server.
* `fmgr_switchcontroller_managedswitch_snmpcommunity` Configuration method to edit Simple Network Management Protocol (SNMP) communities.
* `fmgr_switchcontroller_managedswitch_snmpcommunity_hosts` Configure IPv4 SNMP managers (hosts).
* `fmgr_switchcontroller_managedswitch_snmpsysinfo` Configuration method to edit Simple Network Management Protocol (SNMP) system info.
* `fmgr_switchcontroller_managedswitch_snmptrapthreshold` Configuration method to edit Simple Network Management Protocol (SNMP) trap threshold values.
* `fmgr_switchcontroller_managedswitch_snmpuser` Configuration method to edit Simple Network Management Protocol (SNMP) users.
* `fmgr_switchcontroller_managedswitch_stormcontrol` Configuration method to edit FortiSwitch storm control for measuring traffic activity using data rates to prevent traffic disruption.
* `fmgr_switchcontroller_managedswitch_stpsettings` Configuration method to edit Spanning Tree Protocol (STP) settings used to prevent bridge loops.
* `fmgr_switchcontroller_managedswitch_switchlog` Configuration method to edit FortiSwitch logging settings (logs are transferred to and inserted into the FortiGate event log).
* `fmgr_switchcontroller_managedswitch_switchstpsettings` Configure spanning tree protocol (STP).
* `fmgr_switchcontroller_qos_dot1pmap` Configure FortiSwitch QoS 802.
* `fmgr_switchcontroller_qos_ipdscpmap` Configure FortiSwitch QoS IP precedence/DSCP.
* `fmgr_switchcontroller_qos_ipdscpmap_map` Maps between IP-DSCP value to COS queue.
* `fmgr_switchcontroller_qos_qospolicy` Configure FortiSwitch QoS policy.
* `fmgr_switchcontroller_qos_queuepolicy` Configure FortiSwitch QoS egress queue policy.
* `fmgr_switchcontroller_qos_queuepolicy_cosqueue` COS queue configuration.
* `fmgr_switchcontroller_securitypolicy_8021x` Configure 802.
* `fmgr_switchcontroller_securitypolicy_captiveportal` Names of VLANs that use captive portal authentication.
* `fmgr_sys_api_sdnconnector` Query SDN connector data.
* `fmgr_sys_generate_wsdl` Generate WSDL for specific module and objects.
* `fmgr_sys_login_challenge` Answer a log in challenge question, used following a login/user or login/challenge command.
* `fmgr_sys_login_user` Log into the device with user name and password.
* `fmgr_sys_logout` Log out a session.
* `fmgr_sys_proxy_json` Send and receive JSON request to/from managed devices.
* `fmgr_sys_reboot` Restart FortiManager.
* `fmgr_system_admin_group` User group.
* `fmgr_system_admin_group_member` Group members.
* `fmgr_system_admin_ldap` LDAP server entry configuration.
* `fmgr_system_admin_ldap_adom` Admin domain.
* `fmgr_system_admin_profile` Admin profile.
* `fmgr_system_admin_profile_datamaskcustomfields` Customized datamask fields.
* `fmgr_system_admin_radius` Configure radius.
* `fmgr_system_admin_setting` Admin setting.
* `fmgr_system_admin_tacacs` TACACS+ server entry configuration.
* `fmgr_system_admin_user` Admin user.
* `fmgr_system_admin_user_adom` Admin domain.
* `fmgr_system_admin_user_adomexclude` Excluding admin domain.
* `fmgr_system_admin_user_appfilter` App filter.
* `fmgr_system_admin_user_dashboard` Custom dashboard widgets.
* `fmgr_system_admin_user_dashboardtabs` Custom dashboard.
* `fmgr_system_admin_user_ipsfilter` IPS filter.
* `fmgr_system_admin_user_metadata` Configure meta data.
* `fmgr_system_admin_user_policypackage` Policy package access.
* `fmgr_system_admin_user_restrictdevvdom` Restricted to these devices/VDOMs.
* `fmgr_system_admin_user_webfilter` Web filter.
* `fmgr_system_alertconsole` Alert console.
* `fmgr_system_alertemail` Configure alertemail.
* `fmgr_system_alertevent` Alert events.
* `fmgr_system_alertevent_alertdestination` Alert destination.
* `fmgr_system_autodelete` Automatic deletion policy for logs, reports, archived, and quarantined files.
* `fmgr_system_autodelete_dlpfilesautodeletion` Automatic deletion policy for DLP archives.
* `fmgr_system_autodelete_logautodeletion` Automatic deletion policy for device logs.
* `fmgr_system_autodelete_quarantinefilesautodeletion` Automatic deletion policy for quarantined files.
* `fmgr_system_autodelete_reportautodeletion` Automatic deletion policy for reports.
* `fmgr_system_backup_allsettings` Scheduled backup settings.
* `fmgr_system_certificate_ca` CA certificate.
* `fmgr_system_certificate_crl` Certificate Revocation List.
* `fmgr_system_certificate_local` Local keys and certificates.
* `fmgr_system_certificate_oftp` OFTP certificates and keys.
* `fmgr_system_certificate_remote` Remote certificate.
* `fmgr_system_certificate_ssh` SSH certificates and keys.
* `fmgr_system_connector` Configure connector.
* `fmgr_system_customlanguage` Configure custom languages.
* `fmgr_system_dhcp_server` Configure DHCP servers.
* `fmgr_system_dhcp_server_excluderange` Exclude one or more ranges of IP addresses from being assigned to clients.
* `fmgr_system_dhcp_server_iprange` DHCP IP range configuration.
* `fmgr_system_dhcp_server_options` DHCP options.
* `fmgr_system_dhcp_server_reservedaddress` Options for the DHCP server to assign IP settings to specific MAC addresses.
* `fmgr_system_dm` Configure dm.
* `fmgr_system_dns` DNS configuration.
* `fmgr_system_docker` Docker host.
* `fmgr_system_externalresource` Configure external resource.
* `fmgr_system_fips` Settings for FIPS-CC mode.
* `fmgr_system_fortiguard` Configure FortiGuard services.
* `fmgr_system_fortiview_autocache` FortiView auto-cache settings.
* `fmgr_system_fortiview_setting` FortiView settings.
* `fmgr_system_geoipcountry` no description.
* `fmgr_system_geoipoverride` Configure geographical location mapping for IP address(es) to override mappings from FortiGuard.
* `fmgr_system_geoipoverride_ip6range` Table of IPv6 ranges assigned to country.
* `fmgr_system_geoipoverride_iprange` Table of IP ranges assigned to country.
* `fmgr_system_global` Global range attributes.
* `fmgr_system_guiact` System settings through GUI.
* `fmgr_system_ha` HA configuration.
* `fmgr_system_ha_peer` Peer.
* `fmgr_system_interface` Interface configuration.
* `fmgr_system_interface_ipv6` IPv6 of interface.
* `fmgr_system_locallog_disk_filter` Filter for disk logging.
* `fmgr_system_locallog_disk_setting` Settings for local disk logging.
* `fmgr_system_locallog_fortianalyzer2_filter` Filter for FortiAnalyzer2 logging.
* `fmgr_system_locallog_fortianalyzer2_setting` Settings for locallog to fortianalyzer.
* `fmgr_system_locallog_fortianalyzer3_filter` Filter for FortiAnalyzer3 logging.
* `fmgr_system_locallog_fortianalyzer3_setting` Settings for locallog to fortianalyzer.
* `fmgr_system_locallog_fortianalyzer_filter` Filter for FortiAnalyzer logging.
* `fmgr_system_locallog_fortianalyzer_setting` Settings for locallog to fortianalyzer.
* `fmgr_system_locallog_memory_filter` Filter for memory logging.
* `fmgr_system_locallog_memory_setting` Settings for memory buffer.
* `fmgr_system_locallog_setting` Settings for locallog logging.
* `fmgr_system_locallog_syslogd2_filter` Filter for syslog logging.
* `fmgr_system_locallog_syslogd2_setting` Settings for remote syslog server.
* `fmgr_system_locallog_syslogd3_filter` Filter for syslog logging.
* `fmgr_system_locallog_syslogd3_setting` Settings for remote syslog server.
* `fmgr_system_locallog_syslogd_filter` Filter for syslog logging.
* `fmgr_system_locallog_syslogd_setting` Settings for remote syslog server.
* `fmgr_system_log_alert` Log based alert settings.
* `fmgr_system_log_devicedisable` Disable client device logging.
* `fmgr_system_log_interfacestats` Interface statistics settings.
* `fmgr_system_log_ioc` IoC settings.
* `fmgr_system_log_maildomain` FortiMail domain setting.
* `fmgr_system_log_ratelimit` Logging rate limit.
* `fmgr_system_log_ratelimit_device` Device log rate limit.
* `fmgr_system_log_settings` Log settings.
* `fmgr_system_log_settings_rollinganalyzer` Log rolling policy for Network Analyzer logs.
* `fmgr_system_log_settings_rollinglocal` Log rolling policy for local logs.
* `fmgr_system_log_settings_rollingregular` Log rolling policy for device logs.
* `fmgr_system_logfetch_clientprofile` Log-fetch client profile settings.
* `fmgr_system_logfetch_clientprofile_devicefilter` List of device filter.
* `fmgr_system_logfetch_clientprofile_logfilter` Log content filters.
* `fmgr_system_logfetch_serversettings` Log-fetch server settings.
* `fmgr_system_mail` Alert emails.
* `fmgr_system_mcpolicydisabledadoms` Multicast policy disabled adoms.
* `fmgr_system_meta` no description.
* `fmgr_system_meta_sysmetafields` no description.
* `fmgr_system_metadata_admins` Configure admins.
* `fmgr_system_ntp` NTP settings.
* `fmgr_system_ntp_ntpserver` NTP server.
* `fmgr_system_objecttagging` Configure object tagging.
* `fmgr_system_passwordpolicy` Password policy.
* `fmgr_system_replacemsggroup` Configure replacement message groups.
* `fmgr_system_replacemsggroup_admin` Replacement message table entries.
* `fmgr_system_replacemsggroup_alertmail` Replacement message table entries.
* `fmgr_system_replacemsggroup_auth` Replacement message table entries.
* `fmgr_system_replacemsggroup_automation` Replacement message table entries.
* `fmgr_system_replacemsggroup_custommessage` Replacement message table entries.
* `fmgr_system_replacemsggroup_devicedetectionportal` Replacement message table entries.
* `fmgr_system_replacemsggroup_ec` Replacement message table entries.
* `fmgr_system_replacemsggroup_fortiguardwf` Replacement message table entries.
* `fmgr_system_replacemsggroup_ftp` Replacement message table entries.
* `fmgr_system_replacemsggroup_http` Replacement message table entries.
* `fmgr_system_replacemsggroup_icap` Replacement message table entries.
* `fmgr_system_replacemsggroup_mail` Replacement message table entries.
* `fmgr_system_replacemsggroup_mm1` Replacement message table entries.
* `fmgr_system_replacemsggroup_mm3` Replacement message table entries.
* `fmgr_system_replacemsggroup_mm4` Replacement message table entries.
* `fmgr_system_replacemsggroup_mm7` Replacement message table entries.
* `fmgr_system_replacemsggroup_mms` Replacement message table entries.
* `fmgr_system_replacemsggroup_nacquar` Replacement message table entries.
* `fmgr_system_replacemsggroup_nntp` Replacement message table entries.
* `fmgr_system_replacemsggroup_spam` Replacement message table entries.
* `fmgr_system_replacemsggroup_sslvpn` Replacement message table entries.
* `fmgr_system_replacemsggroup_trafficquota` Replacement message table entries.
* `fmgr_system_replacemsggroup_utm` Replacement message table entries.
* `fmgr_system_replacemsggroup_webproxy` Replacement message table entries.
* `fmgr_system_replacemsgimage` Configure replacement message images.
* `fmgr_system_report_autocache` Report auto-cache settings.
* `fmgr_system_report_estbrowsetime` Report estimated browse time settings.
* `fmgr_system_report_group` Report group.
* `fmgr_system_report_group_chartalternative` Chart alternatives.
* `fmgr_system_report_group_groupby` Group-by variables.
* `fmgr_system_report_setting` Report settings.
* `fmgr_system_route` Routing table configuration.
* `fmgr_system_route6` Routing table configuration.
* `fmgr_system_saml` Global settings for SAML authentication.
* `fmgr_system_saml_fabricidp` Authorized identity providers.
* `fmgr_system_sdnconnector` Configure connection to SDN Connector.
* `fmgr_system_sdnconnector_externalip` Configure GCP external IP.
* `fmgr_system_sdnconnector_nic` Configure Azure network interface.
* `fmgr_system_sdnconnector_nic_ip` Configure IP configuration.
* `fmgr_system_sdnconnector_route` Configure GCP route.
* `fmgr_system_sdnconnector_routetable` Configure Azure route table.
* `fmgr_system_sdnconnector_routetable_route` Configure Azure route.
* `fmgr_system_smsserver` Configure SMS server for sending SMS messages to support user authentication.
* `fmgr_system_sniffer` Interface sniffer.
* `fmgr_system_snmp_community` SNMP community configuration.
* `fmgr_system_snmp_community_hosts` Allow hosts configuration.
* `fmgr_system_snmp_community_hosts6` Allow hosts configuration for IPv6.
* `fmgr_system_snmp_sysinfo` SNMP configuration.
* `fmgr_system_snmp_user` SNMP user configuration.
* `fmgr_system_socfabric` SOC Fabric.
* `fmgr_system_sql` SQL settings.
* `fmgr_system_sql_customindex` List of SQL index fields.
* `fmgr_system_sql_customskipidx` List of aditional SQL skip index fields.
* `fmgr_system_sql_tsindexfield` List of SQL text search index fields.
* `fmgr_system_syslog` Syslog servers.
* `fmgr_system_virtualwirepair` Configure virtual wire pairs.
* `fmgr_system_workflow_approvalmatrix` workflow approval matrix.
* `fmgr_system_workflow_approvalmatrix_approver` Approver.
* `fmgr_template` no description.
* `fmgr_templategroup` no description.
* `fmgr_user_adgrp` Configure FSSO groups.
* `fmgr_user_clearpass` no description.
* `fmgr_user_device` Configure devices.
* `fmgr_user_device_dynamicmapping` no description.
* `fmgr_user_device_tagging` Config object tagging.
* `fmgr_user_devicecategory` Configure device categories.
* `fmgr_user_devicegroup` Configure device groups.
* `fmgr_user_devicegroup_dynamicmapping` no description.
* `fmgr_user_devicegroup_tagging` Config object tagging.
* `fmgr_user_domaincontroller` Configure domain controller entries.
* `fmgr_user_domaincontroller_extraserver` extra servers.
* `fmgr_user_exchange` Configure MS Exchange server entries.
* `fmgr_user_fortitoken` Configure FortiToken.
* `fmgr_user_fsso` Configure Fortinet Single Sign On (FSSO) agents.
* `fmgr_user_fsso_dynamicmapping` Configure Fortinet Single Sign On (FSSO) agents.
* `fmgr_user_fssopolling` Configure FSSO active directory servers for polling mode.
* `fmgr_user_fssopolling_adgrp` LDAP Group Info.
* `fmgr_user_group` Configure user groups.
* `fmgr_user_group_guest` Guest User.
* `fmgr_user_group_match` Group matches.
* `fmgr_user_krbkeytab` Configure Kerberos keytab entries.
* `fmgr_user_ldap` Configure LDAP server entries.
* `fmgr_user_ldap_dynamicmapping` Configure LDAP server entries.
* `fmgr_user_local` Configure local users.
* `fmgr_user_nsx` no description.
* `fmgr_user_passwordpolicy` Configure user password policy.
* `fmgr_user_peer` Configure peer users.
* `fmgr_user_peergrp` Configure peer groups.
* `fmgr_user_pop3` POP3 server entry configuration.
* `fmgr_user_pxgrid` no description.
* `fmgr_user_radius` Configure RADIUS server entries.
* `fmgr_user_radius_accountingserver` Additional accounting servers.
* `fmgr_user_radius_dynamicmapping` Configure RADIUS server entries.
* `fmgr_user_radius_dynamicmapping_accountingserver` Additional accounting servers.
* `fmgr_user_saml` SAML server entry configuration.
* `fmgr_user_securityexemptlist` Configure security exemption list.
* `fmgr_user_securityexemptlist_rule` Configure rules for exempting users from captive portal authentication.
* `fmgr_user_tacacs` Configure TACACS+ server entries.
* `fmgr_user_tacacs_dynamicmapping` Configure TACACS+ server entries.
* `fmgr_user_vcenter` no description.
* `fmgr_user_vcenter_rule` no description.
* `fmgr_utmprofile` Configure UTM (Unified Threat Management) profile.
* `fmgr_vap` Configure Virtual Access Points (VAPs).
* `fmgr_vap_dynamicmapping` Configure Virtual Access Points (VAPs).
* `fmgr_vap_macfilterlist` Create a list of MAC addresses for MAC address filtering.
* `fmgr_vap_mpskkey` Pre-shared keys that can be used to connect to this virtual access point.
* `fmgr_vap_portalmessageoverrides` Individual message overrides.
* `fmgr_vap_vlanpool` VLAN pool.
* `fmgr_vapgroup` Configure virtual Access Point (VAP) groups.
* `fmgr_videofilter_profile` Configure VideoFilter profile.
* `fmgr_videofilter_profile_fortiguardcategory` Configure FortiGuard categories.
* `fmgr_videofilter_profile_fortiguardcategory_filters` Configure VideoFilter FortiGuard category.
* `fmgr_videofilter_youtubechannelfilter` Configure YouTube channel filter.
* `fmgr_videofilter_youtubechannelfilter_entries` YouTube filter entries.
* `fmgr_voip_profile` Configure VoIP profiles.
* `fmgr_voip_profile_sccp` SCCP.
* `fmgr_voip_profile_sip` SIP.
* `fmgr_vpn_certificate_ca` CA certificate.
* `fmgr_vpn_certificate_ocspserver` OCSP server configuration.
* `fmgr_vpn_certificate_remote` Remote certificate as a PEM file.
* `fmgr_vpn_ssl_settings` Configure SSL VPN.
* `fmgr_vpn_ssl_settings_authenticationrule` Authentication rule for SSL VPN.
* `fmgr_vpnmgr_node` VPN node for VPN Manager.
* `fmgr_vpnmgr_node_iprange` no description.
* `fmgr_vpnmgr_node_ipv4excluderange` no description.
* `fmgr_vpnmgr_node_protectedsubnet` no description.
* `fmgr_vpnmgr_node_summaryaddr` no description.
* `fmgr_vpnmgr_vpntable` no description.
* `fmgr_vpnsslweb_hostchecksoftware` SSL-VPN host check software.
* `fmgr_vpnsslweb_hostchecksoftware_checkitemlist` Check item list.
* `fmgr_vpnsslweb_portal` Portal.
* `fmgr_vpnsslweb_portal_bookmarkgroup` Portal bookmark group.
* `fmgr_vpnsslweb_portal_bookmarkgroup_bookmarks` Bookmark table.
* `fmgr_vpnsslweb_portal_bookmarkgroup_bookmarks_formdata` Form data.
* `fmgr_vpnsslweb_portal_macaddrcheckrule` Client MAC address check rule.
* `fmgr_vpnsslweb_portal_oschecklist` SSL VPN OS checks.
* `fmgr_vpnsslweb_portal_splitdns` Split DNS for SSL VPN.
* `fmgr_vpnsslweb_realm` Realm.
* `fmgr_waf_mainclass` Hidden table for datasource.
* `fmgr_waf_profile` Web application firewall configuration.
* `fmgr_waf_profile_addresslist` Black address list and white address list.
* `fmgr_waf_profile_constraint` WAF HTTP protocol restrictions.
* `fmgr_waf_profile_constraint_contentlength` HTTP content length in request.
* `fmgr_waf_profile_constraint_exception` HTTP constraint exception.
* `fmgr_waf_profile_constraint_headerlength` HTTP header length in request.
* `fmgr_waf_profile_constraint_hostname` Enable/disable hostname check.
* `fmgr_waf_profile_constraint_linelength` HTTP line length in request.
* `fmgr_waf_profile_constraint_malformed` Enable/disable malformed HTTP request check.
* `fmgr_waf_profile_constraint_maxcookie` Maximum number of cookies in HTTP request.
* `fmgr_waf_profile_constraint_maxheaderline` Maximum number of HTTP header line.
* `fmgr_waf_profile_constraint_maxrangesegment` Maximum number of range segments in HTTP range line.
* `fmgr_waf_profile_constraint_maxurlparam` Maximum number of parameters in URL.
* `fmgr_waf_profile_constraint_method` Enable/disable HTTP method check.
* `fmgr_waf_profile_constraint_paramlength` Maximum length of parameter in URL, HTTP POST request or HTTP body.
* `fmgr_waf_profile_constraint_urlparamlength` Maximum length of parameter in URL.
* `fmgr_waf_profile_constraint_version` Enable/disable HTTP version check.
* `fmgr_waf_profile_method` Method restriction.
* `fmgr_waf_profile_method_methodpolicy` HTTP method policy.
* `fmgr_waf_profile_signature` WAF signatures.
* `fmgr_waf_profile_signature_customsignature` Custom signature.
* `fmgr_waf_profile_signature_mainclass` Main signature class.
* `fmgr_waf_profile_urlaccess` URL access list.
* `fmgr_waf_profile_urlaccess_accesspattern` URL access pattern.
* `fmgr_waf_signature` Hidden table for datasource.
* `fmgr_waf_subclass` Hidden table for datasource.
* `fmgr_wagprofile` Configure wireless access gateway (WAG) profiles used for tunnels on AP.
* `fmgr_wanopt_authgroup` Configure WAN optimization authentication groups.
* `fmgr_wanopt_peer` Configure WAN optimization peers.
* `fmgr_wanopt_profile` Configure WAN optimization profiles.
* `fmgr_wanopt_profile_cifs` Enable/disable CIFS (Windows sharing) WAN Optimization and configure CIFS WAN Optimization features.
* `fmgr_wanopt_profile_ftp` Enable/disable FTP WAN Optimization and configure FTP WAN Optimization features.
* `fmgr_wanopt_profile_http` Enable/disable HTTP WAN Optimization and configure HTTP WAN Optimization features.
* `fmgr_wanopt_profile_mapi` Enable/disable MAPI email WAN Optimization and configure MAPI WAN Optimization features.
* `fmgr_wanopt_profile_tcp` Enable/disable TCP WAN Optimization and configure TCP WAN Optimization features.
* `fmgr_wanprof_system_sdwan` Configure redundant internet connections using SD-WAN (formerly virtual WAN link).
* `fmgr_wanprof_system_sdwan_duplication` Create SD-WAN duplication rule.
* `fmgr_wanprof_system_sdwan_healthcheck` SD-WAN status checking or health checking.
* `fmgr_wanprof_system_sdwan_healthcheck_sla` Service level agreement (SLA).
* `fmgr_wanprof_system_sdwan_members` FortiGate interfaces added to the SD-WAN.
* `fmgr_wanprof_system_sdwan_neighbor` Create SD-WAN neighbor from BGP neighbor table to control route advertisements according to SLA status.
* `fmgr_wanprof_system_sdwan_service` Create SD-WAN rules (also called services) to control how sessions are distributed to interfaces in the SD-WAN.
* `fmgr_wanprof_system_sdwan_service_sla` Service level agreement (SLA).
* `fmgr_wanprof_system_sdwan_zone` Configure SD-WAN zones.
* `fmgr_wanprof_system_virtualwanlink` Configure redundant internet connections using SD-WAN (formerly virtual WAN link).
* `fmgr_wanprof_system_virtualwanlink_healthcheck` SD-WAN status checking or health checking.
* `fmgr_wanprof_system_virtualwanlink_healthcheck_sla` Service level agreement (SLA).
* `fmgr_wanprof_system_virtualwanlink_members` Physical FortiGate interfaces added to the virtual-wan-link.
* `fmgr_wanprof_system_virtualwanlink_neighbor` SD-WAN neighbor table.
* `fmgr_wanprof_system_virtualwanlink_service` Create SD-WAN rules or priority rules (also called services) to control how sessions are distributed to physical interfaces in the SD-WAN.
* `fmgr_wanprof_system_virtualwanlink_service_sla` Service level agreement (SLA).
* `fmgr_webfilter_categories` no description.
* `fmgr_webfilter_content` Configure Web filter banned word table.
* `fmgr_webfilter_content_entries` Configure banned word entries.
* `fmgr_webfilter_contentheader` Configure content types used by Web filter.
* `fmgr_webfilter_contentheader_entries` Configure content types used by web filter.
* `fmgr_webfilter_ftgdlocalcat` Configure FortiGuard Web Filter local categories.
* `fmgr_webfilter_ftgdlocalrating` Configure local FortiGuard Web Filter local ratings.
* `fmgr_webfilter_profile` Configure Web filter profiles.
* `fmgr_webfilter_profile_antiphish` AntiPhishing profile.
* `fmgr_webfilter_profile_antiphish_custompatterns` Custom username and password regex patterns.
* `fmgr_webfilter_profile_antiphish_inspectionentries` AntiPhishing entries.
* `fmgr_webfilter_profile_filefilter` File filter.
* `fmgr_webfilter_profile_filefilter_entries` File filter entries.
* `fmgr_webfilter_profile_ftgdwf` FortiGuard Web Filter settings.
* `fmgr_webfilter_profile_ftgdwf_filters` FortiGuard filters.
* `fmgr_webfilter_profile_ftgdwf_quota` FortiGuard traffic quota settings.
* `fmgr_webfilter_profile_override` Web Filter override settings.
* `fmgr_webfilter_profile_urlextraction` Configure URL Extraction.
* `fmgr_webfilter_profile_web` Web content filtering settings.
* `fmgr_webfilter_profile_youtubechannelfilter` YouTube channel filter.
* `fmgr_webfilter_urlfilter` Configure URL filter lists.
* `fmgr_webfilter_urlfilter_entries` URL filter entries.
* `fmgr_webproxy_forwardserver` Configure forward-server addresses.
* `fmgr_webproxy_forwardservergroup` Configure a forward server group consisting or multiple forward servers.
* `fmgr_webproxy_forwardservergroup_serverlist` Add web forward servers to a list to form a server group.
* `fmgr_webproxy_profile` Configure web proxy profiles.
* `fmgr_webproxy_profile_headers` Configure HTTP forwarded requests headers.
* `fmgr_webproxy_wisp` Configure Wireless Internet service provider (WISP) servers.
* `fmgr_widsprofile` Configure wireless intrusion detection system (WIDS) profiles.
* `fmgr_wtpprofile` Configure WTP profiles or FortiAP profiles that define radio settings for manageable FortiAP platforms.
* `fmgr_wtpprofile_denymaclist` List of MAC addresses that are denied access to this WTP, FortiAP, or AP.
* `fmgr_wtpprofile_lan` WTP LAN port mapping.
* `fmgr_wtpprofile_lbs` Set various location based service (LBS) options.
* `fmgr_wtpprofile_platform` WTP, FortiAP, or AP platform.
* `fmgr_wtpprofile_radio1` Configuration options for radio 1.
* `fmgr_wtpprofile_radio2` Configuration options for radio 2.
* `fmgr_wtpprofile_radio3` Configuration options for radio 3.
* `fmgr_wtpprofile_radio4` Configuration options for radio 4.
* `fmgr_wtpprofile_splittunnelingacl` Split tunneling ACL filter list.

View File

@@ -0,0 +1,22 @@
ancestor: null
releases:
2.1.6:
changes:
major_changes:
- Many fixes for Ansible sanity test warnings & errors.
- Support FortiManager Schema 7.2.0 , 98 new modules
minor_changes:
- Best Practice Notes
release_summary: release fortinet.fortimanager to support FMG 7.2.x
fragments:
- release_2.1.6.yaml
release_date: '2022-10-31'
2.1.7:
changes:
major_changes:
- Fix compatibility issue for ansible 2.9.x and ansible-base 2.10.x.
- support Ansible changelogs.
release_summary: hotpath for backward-compatibility fix
fragments:
- release.2.1.7.yaml
release_date: '2022-11-12'

View File

@@ -0,0 +1,32 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sanitize_changelog: true
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Fortinet.Fortimanager
trivial_section_name: trivial
use_fqcn: true

View File

@@ -0,0 +1,2 @@
---
requires_ansible: '>=2.9.0'

View File

@@ -0,0 +1,31 @@
# Collections Plugins Directory
This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that
is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that
would contain module utils and modules respectively.
Here is an example directory of the majority of plugins currently supported by Ansible:
```
└── plugins
├── action
├── become
├── cache
├── callback
├── cliconf
├── connection
├── filter
├── httpapi
├── inventory
├── lookup
├── module_utils
├── modules
├── netconf
├── shell
├── strategy
├── terminal
├── test
└── vars
```
A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible/devel/plugins/plugins.html).

View File

@@ -0,0 +1,642 @@
# Copyright (c) 2018-2021 Fortinet and/or its affiliates.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
author:
- Link Zheng (@chillancezen)
- Luke Weighall (@lweighall)
- Andrew Welsh (@Ghilli3)
- Jim Huber (@p4r4n0y1ng)
httpapi : fortimanager
short_description: HttpApi Plugin for Fortinet FortiManager Appliance or VM.
description:
- This HttpApi plugin provides methods to connect to Fortinet FortiManager Appliance or VM via JSON RPC API.
version_added: "2.8"
"""
import time
import json
import traceback
from ansible.plugins.httpapi import HttpApiBase
from ansible.module_utils.basic import to_text
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
BASE_HEADERS,
)
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
FMGBaseException,
)
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
FMGRCommon,
)
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
FMGRMethods,
)
from datetime import datetime
class HttpApi(HttpApiBase):
def __init__(self, connection):
super(HttpApi, self).__init__(connection)
self._req_id = 0
self._sid = None
self._url = "/jsonrpc"
self._host = None
self._tools = FMGRCommon
self._debug = False
self._connected_fmgr = None
self._last_response_msg = None
self._last_response_code = None
self._last_data_payload = None
self._last_url = None
self._last_response_raw = None
self._locked_adom_list = list()
self._locked_adoms_by_user = dict()
self._uses_workspace = False
self._uses_adoms = False
self._adom_list = list()
self._logged_in_user = None
self._logged = False
self._log = None
self._prelocking_user_params = list()
def get_forticloud_access_token(self):
try:
token = self.connection.get_option("forticloud_access_token")
return token
except Exception as e:
return None
def log(self, msg):
try:
log_enabled = self.connection.get_option("enable_log")
except Exception as e:
return
if not log_enabled:
return
if not self._log:
self._log = open("/tmp/fortimanager.ansible.log", "a")
log_message = str(datetime.now())
log_message += ": " + str(msg) + "\n"
self._log.write(log_message)
self._log.flush()
def set_become(self, become_context):
"""
ELEVATION IS NOT REQUIRED ON FORTINET DEVICES - SKIPPED
:param become_context: Unused input.
:return: None
"""
return None
def update_auth(self, response, response_text):
"""
TOKENS ARE NOT USED SO NO NEED TO UPDATE AUTH
:param response: Unused input.
:param response_data Unused_input.
:return: None
"""
return None
def forticloud_login(self):
login_data = '{"access_token": "%s"}' % (self.get_forticloud_access_token())
try:
response, response_data = self.connection.send(
path=to_text("/p/forticloud_jsonrpc_login/"),
data=to_text(login_data),
headers=BASE_HEADERS,
)
result = json.loads(to_text(response_data.getvalue()))
self.log("forticloud login response: %s" % (str(self._jsonize(result))))
return self._set_sid(result)
except Exception as e:
raise FMGBaseException(e)
def login(self, username, password):
"""
This function will log the plugin into FortiManager, and return the results.
:param username: Username of FortiManager Admin
:param password: Password of FortiManager Admin
:return: Dictionary of status, if it logged in or not.
"""
self.log("login begin, user: %s" % (username))
self._logged_in_user = username
forticloud_access_token = self.get_forticloud_access_token()
self.log(
"forticloud access token: %s"
% (forticloud_access_token if forticloud_access_token else "(not set)")
)
if not forticloud_access_token:
self.send_request(
FMGRMethods.EXEC,
self._tools.format_request(
FMGRMethods.EXEC, "sys/login/user", passwd=password, user=username
),
)
else:
self.forticloud_login()
self.log(self)
if "FortiManager object connected to FortiManager" in self.__str__():
# If Login worked, then inspect the FortiManager for Workspace Mode, and it's system information.
self.inspect_fmgr()
self._logged = True
for param in self._prelocking_user_params:
self.process_workspace_locking_internal(param)
else:
raise FMGBaseException(
msg="Unknown error while logging in...connection was lost during login operation...."
" Exiting"
)
def inspect_fmgr(self):
# CHECK FOR WORKSPACE MODE TO SEE IF WE HAVE TO ENABLE ADOM LOCKS
status = self.get_system_status()
self.log("system status:\n" + json.dumps(status, indent=4))
if status[0] == -11:
# THE CONNECTION GOT LOST SOMEHOW, REMOVE THE SID AND REPORT BAD LOGIN
self.logout()
raise FMGBaseException(
msg="Error -11 -- the Session ID was likely malformed somehow. Contact authors."
" Exiting"
)
elif status[0] == 0:
try:
self.check_mode()
if self._uses_adoms:
self.get_adom_list()
if self._uses_workspace:
self.get_locked_adom_list()
self._connected_fmgr = status[1]
self._host = self._connected_fmgr["data"]["Hostname"]
except Exception as e:
self.log("inspect_fmgr exception: %s" % (e))
self.log(traceback.format_exc())
def logout(self):
"""
This function will logout of the FortiManager.
"""
self.log(
"log out, using workspace:%s user: %s sid: %s"
% (self._uses_workspace, self._logged_in_user, self.sid)
)
if self.sid:
# IF WE WERE USING WORKSPACES, THEN CLEAN UP OUR LOCKS IF THEY STILL EXIST
if self._uses_workspace:
# self.get_lock_info()
self.run_unlock()
ret_code, response = self.send_request(
FMGRMethods.EXEC,
self._tools.format_request(FMGRMethods.EXEC, "sys/logout"),
)
self.sid = None
return ret_code, response
def send_request(self, method, params):
"""
Responsible for actual sending of data to the connection httpapi base plugin. Does some formatting as well.
:param params: A formatted dictionary that was returned by self.common_datagram_params()
before being called here.
:param method: The preferred API Request method (GET, ADD, POST, etc....)
:type method: basestring
:return: Dictionary of status, if it logged in or not.
"""
try:
if self.sid is None and params[0]["url"] != "sys/login/user":
if not self.connection._connected:
self.connection._connect()
except IndexError:
raise FMGBaseException(
"An attempt was made at communicating with a FMG with "
"no valid session and an incorrectly formatted request."
)
except Exception:
raise FMGBaseException(
"An attempt was made at communicating with a FMG with "
"no valid session and an unexpected error was discovered."
)
self._update_request_id()
json_request = {
"method": method,
"params": params,
"session": self.sid,
"id": self.req_id,
"verbose": 1,
}
data = json.dumps(json_request, ensure_ascii=False).replace("\\\\", "\\")
self.log("request: %s" % (data))
try:
# Sending URL and Data in Unicode, per Ansible Specifications for Connection Plugins
response, response_data = self.connection.send(
path=to_text(self._url), data=to_text(data), headers=BASE_HEADERS
)
# Get Unicode Response - Must convert from StringIO to unicode first so we can do a replace function below
result = json.loads(to_text(response_data.getvalue()))
self.log("response: %s" % (str(self._jsonize(result))))
self._update_self_from_response(result, self._url, data)
return self._handle_response(result)
except Exception as err:
raise FMGBaseException(err)
def _jsonize(self, data):
ret = None
try:
ret = json.dumps(data, indent=3)
except Exception as e:
pass
return ret
def _handle_response(self, response):
self._set_sid(response)
if isinstance(response["result"], list):
result = response["result"][0]
else:
result = response["result"]
return result["status"]["code"], result
def _update_self_from_response(self, response, url, data):
self._last_response_raw = response
if isinstance(response["result"], list):
result = response["result"][0]
else:
result = response["result"]
if "status" in result:
self._last_response_code = result["status"]["code"]
self._last_response_msg = result["status"]["message"]
self._last_url = url
self._last_data_payload = data
def _set_sid(self, response):
if self.sid is None and "session" in response:
self.sid = response["session"]
def return_connected_fmgr(self):
"""
Returns the data stored under self._connected_fmgr
:return: dict
"""
try:
if self._connected_fmgr:
return self._connected_fmgr
except Exception:
raise FMGBaseException("Couldn't Retrieve Connected FMGR Stats")
def get_system_status(self):
"""
Returns the system status page from the FortiManager, for logging and other uses.
return: status
"""
status = self.send_request(
FMGRMethods.GET, self._tools.format_request(FMGRMethods.GET, "sys/status")
)
return status
def process_workspace_locking_internal(self, param):
if not self._uses_workspace or not self.sid:
return
if "workspace_locking_adom" not in param or not param["workspace_locking_adom"]:
# The FortiManager is running in workspace mode, please `workspace_locking_adom` in your playbook
# FIXME:by default, users have to know whether their fmg devices are running in worksapce mode and
# specify the paramters in plaubook, we will find a better way to notify the users of this error
return
adom_to_lock = param["workspace_locking_adom"]
adom_to_lock_timeout = param["workspace_locking_timeout"]
self.log(
"trying to acquire lock for adom: %s within %s seconds by user: %s"
% (adom_to_lock, adom_to_lock_timeout, self._logged_in_user)
)
if (
adom_to_lock in self._locked_adoms_by_user
and self._locked_adoms_by_user[adom_to_lock] == self._logged_in_user
):
# XXX: here is a situation where user can still has no permission to access resources:
# indeed the worksapce lock is acquired by the user himself, but the lock is not
# associated with this session.
self.log(
"adom: %s has already been acquired by user: %s"
% (adom_to_lock, self._logged_in_user)
)
elif (
adom_to_lock in self._locked_adoms_by_user
and self._locked_adoms_by_user[adom_to_lock] != self._logged_in_user
):
total_wait_time = 0
while total_wait_time < adom_to_lock_timeout:
code, dummy = self.lock_adom(adom_to_lock)
self.log(
"waiting adom:%s lock to be released by %s, total time spent:%s seconds status:%s"
% (
adom_to_lock,
self._locked_adoms_by_user[adom_to_lock],
total_wait_time,
"success" if code == 0 else "failure",
)
)
if code == 0:
self._locked_adoms_by_user[adom_to_lock] = self._logged_in_user
break
time.sleep(5)
total_wait_time += 5
else:
code, dummy = self.lock_adom(adom_to_lock)
self.log(
"adom:%s locked by user: %s status:%s"
% (
adom_to_lock,
self._logged_in_user,
"success" if code == 0 else "failure",
)
)
if code == 0:
self._locked_adoms_by_user[adom_to_lock] = self._logged_in_user
def process_workspace_locking(self, param):
# XXX:defer the lock acquisition process after login is done
# it requires that the first task specify the workspace locking adom
# if it's really executed in lock context
if not self._logged:
self._prelocking_user_params.append(param)
else:
self.process_workspace_locking_internal(param)
@property
def debug(self):
return self._debug
@debug.setter
def debug(self, val):
self._debug = val
@property
def req_id(self):
return self._req_id
@req_id.setter
def req_id(self, val):
self._req_id = val
def _update_request_id(self, reqid=0):
self.req_id = reqid if reqid != 0 else self.req_id + 1
@property
def sid(self):
return self._sid
@sid.setter
def sid(self, val):
self._sid = val
def __str__(self):
if self.sid is not None and self.connection._url is not None:
return "FortiManager object connected to FortiManager: " + to_text(
self.connection._url
)
return (
"FortiManager object with no valid connection to a FortiManager appliance."
)
##################################
# BEGIN DATABASE LOCK CONTEXT CODE
##################################
@property
def uses_workspace(self):
return self._uses_workspace
@uses_workspace.setter
def uses_workspace(self, val):
self._uses_workspace = val
@property
def uses_adoms(self):
return self._uses_adoms
@uses_adoms.setter
def uses_adoms(self, val):
self._uses_adoms = val
def add_adom_to_lock_list(self, adom):
if adom not in self._locked_adom_list:
self._locked_adom_list.append(adom)
def remove_adom_from_lock_list(self, adom):
if adom in self._locked_adom_list:
self._locked_adom_list.remove(adom)
def check_mode(self):
"""
Checks FortiManager for the use of Workspace mode
"""
url = "/cli/global/system/global"
code, resp_obj = self.send_request(
FMGRMethods.GET,
self._tools.format_request(
FMGRMethods.GET, url, fields=["workspace-mode", "adom-status"]
),
)
try:
if resp_obj["data"]["workspace-mode"] in ["workflow", "normal"]:
self._uses_workspace = True
else:
self._uses_workspace = False
except KeyError:
raise FMGBaseException(
msg="Couldn't determine workspace-mode in the plugin"
)
try:
if resp_obj["data"]["adom-status"] in [1, "enable"]:
self._uses_adoms = True
else:
self._uses_adoms = False
except KeyError:
raise FMGBaseException(msg="Couldn't determine adom-status in the plugin")
self.log(
"workspace-mode: %s adom-status: %s"
% (self._uses_workspace, self._uses_adoms)
)
def run_unlock(self):
"""
Checks for ADOM status, if locked, it will unlock
"""
for adom_locked in self._locked_adoms_by_user:
locked_user = self._locked_adoms_by_user[adom_locked]
if locked_user == self._logged_in_user:
self.commit_changes(adom_locked)
self.unlock_adom(adom_locked)
self.log("unlock adom: %s with session_id:%s" % (adom_locked, self.sid))
def lock_adom(self, adom=None, *args, **kwargs):
"""
Locks an ADOM for changes
"""
if adom:
if adom.lower() == "global":
url = "/dvmdb/global/workspace/lock/"
else:
url = "/dvmdb/adom/{adom}/workspace/lock/".format(adom=adom)
else:
url = "/dvmdb/adom/root/workspace/lock"
code, respobj = self.send_request(
FMGRMethods.EXEC, self._tools.format_request(FMGRMethods.EXEC, url)
)
if code == 0 and respobj["status"]["message"].lower() == "ok":
self.add_adom_to_lock_list(adom)
return code, respobj
def unlock_adom(self, adom=None, *args, **kwargs):
"""
Unlocks an ADOM after changes
"""
if adom:
if adom.lower() == "global":
url = "/dvmdb/global/workspace/unlock/"
else:
url = "/dvmdb/adom/{adom}/workspace/unlock/".format(adom=adom)
else:
url = "/dvmdb/adom/root/workspace/unlock"
code, respobj = self.send_request(
FMGRMethods.EXEC, self._tools.format_request(FMGRMethods.EXEC, url)
)
if code == 0 and respobj["status"]["message"].lower() == "ok":
self.remove_adom_from_lock_list(adom)
return code, respobj
def commit_changes(self, adom=None, aux=False, *args, **kwargs):
"""
Commits changes to an ADOM
"""
if adom:
if aux:
url = "/pm/config/adom/{adom}/workspace/commit".format(adom=adom)
else:
if adom.lower() == "global":
url = "/dvmdb/global/workspace/commit/"
else:
url = "/dvmdb/adom/{adom}/workspace/commit".format(adom=adom)
else:
url = "/dvmdb/adom/root/workspace/commit"
return self.send_request(
FMGRMethods.EXEC, self._tools.format_request(FMGRMethods.EXEC, url)
)
def get_lock_info(self, adom=None):
"""
Gets ADOM lock info so it can be displayed with the error messages. Or if determined to be locked by ansible
for some reason, then unlock it.
"""
if not adom or adom == "root":
url = "/dvmdb/adom/root/workspace/lockinfo"
else:
if adom.lower() == "global":
url = "/dvmdb/global/workspace/lockinfo/"
else:
url = "/dvmdb/adom/{adom}/workspace/lockinfo/".format(adom=adom)
datagram = {}
data = self._tools.format_request(FMGRMethods.GET, url, **datagram)
resp_obj = self.send_request(FMGRMethods.GET, data)
code = resp_obj[0]
if code != 0:
self._module.fail_json(
msg=(
"An error occurred trying to get the ADOM Lock Info. "
"Error: " + to_text(resp_obj)
)
)
elif code == 0:
try:
if resp_obj[1]["status"]["message"] == "OK":
self._lock_info = None
except Exception:
self._lock_info = resp_obj[1]
return resp_obj
def get_adom_list(self):
"""
Gets the list of ADOMs for the FortiManager
"""
if self._uses_adoms:
url = "/dvmdb/adom"
datagram = {}
data = self._tools.format_request(FMGRMethods.GET, url, **datagram)
resp_obj = self.send_request(FMGRMethods.GET, data)
code = resp_obj[0]
if code != 0:
self._module.fail_json(
msg=(
"An error occurred trying to get the ADOM Info. "
"Error: " + to_text(resp_obj)
)
)
elif code == 0:
num_of_adoms = len(resp_obj[1]["data"])
append_list = ["root", "global"]
for adom in resp_obj[1]["data"]:
if adom["tab_status"] != "":
append_list.append(to_text(adom["name"]))
self._adom_list = append_list
self.log("adom list: %s" % (str(self._adom_list)))
return resp_obj
def get_locked_adom_list(self):
"""
Gets the list of locked adoms
"""
try:
locked_list = list()
locked_by_user_list = dict()
for adom in self._adom_list:
adom_lock_info = self.get_lock_info(adom=adom)
self.log("lockinfo for adom:%s" % (adom))
self.log(json.dumps(adom_lock_info, indent=4))
if adom_lock_info[1]["status"]["code"] != 0:
continue
# if 'data' is not in the response, the adom is locked by no one
if "data" not in adom_lock_info[1]:
continue
locked_list.append(to_text(adom))
locked_by_user_list[to_text(adom)] = to_text(
adom_lock_info[1]["data"][0]["lock_user"]
)
self._locked_adom_list = locked_list
self._locked_adoms_by_user = locked_by_user_list
self.log("locked adom list: %s" % (self._locked_adom_list))
self.log("locked adom and user list: %s" % (self._locked_adoms_by_user))
except Exception as err:
raise FMGBaseException(
msg=(
"An error occurred while trying to get the locked adom list. Error: "
+ to_text(err)
)
)
################################
# END DATABASE LOCK CONTEXT CODE
################################

View File

@@ -0,0 +1,612 @@
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete work.
#
# (c) 2017-2020 Fortinet, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# BEGIN STATIC DATA / MESSAGES
class FMGRMethods:
GET = "get"
SET = "set"
EXEC = "exec"
EXECUTE = "exec"
UPDATE = "update"
ADD = "add"
DELETE = "delete"
REPLACE = "replace"
CLONE = "clone"
MOVE = "move"
BASE_HEADERS = {"Content-Type": "application/json", "Accept": "application/json"}
# FMGR RETURN CODES
FMGR_RC = {
"fmgr_return_codes": {
0: {"msg": "OK", "changed": True, "stop_on_success": True},
-100000: {
"msg": "Module returned without actually running anything. "
"Check parameters, and please contact the authors if needed.",
"failed": True,
},
-2: {
"msg": "Object already exists.",
"skipped": True,
"changed": False,
"good_codes": [0, -2],
},
-6: {
"msg": "Invalid Url. Sometimes this can happen because the path is mapped to a hostname or object that"
" doesn't exist. Double check your input object parameters."
},
-3: {
"msg": "Object doesn't exist.",
"skipped": True,
"changed": False,
"good_codes": [0, -3],
},
-10131: {
"msg": "Object dependency failed. Do all named objects in parameters exist?",
"changed": False,
"skipped": True,
},
-9998: {
"msg": "Duplicate object. Try using mode='set', if using add. STOPPING. Use 'ignore_errors=yes' in playbook"
"to override and mark successful."
},
-20042: {"msg": "Device Unreachable.", "skipped": True},
-10033: {
"msg": "Duplicate object. Try using mode='set', if using add.",
"changed": False,
"skipped": True,
},
-10000: {
"msg": "Duplicate object. Try using mode='set', if using add.",
"changed": False,
"skipped": True,
},
-20010: {
"msg": "Device already added to FortiManager. Serial number already in use.",
"good_codes": [0, -20010],
"changed": False,
"stop_on_success": True,
},
-20002: {
"msg": "Invalid Argument -- Does this Device exist on FortiManager?",
"changed": False,
"skipped": True,
},
}
}
DEFAULT_RESULT_OBJ = (
-100000,
{"msg": "Nothing Happened. Check that handle_response is being called!"},
)
FAIL_SOCKET_MSG = {
"msg": "Socket Path Empty! The persistent connection manager is messed up. "
"Try again in a few moments."
}
# BEGIN ERROR EXCEPTIONS
class FMGBaseException(Exception):
"""Wrapper to catch the unexpected"""
def __init__(self, msg=None, *args, **kwargs):
if msg is None:
msg = "An exception occurred within the fortimanager.py httpapi connection plugin."
super(FMGBaseException, self).__init__(msg, *args)
# END ERROR CLASSES
# BEGIN CLASSES
class FMGRCommon(object):
@staticmethod
def format_request(method, url, *args, **kwargs):
"""
Formats the payload from the module, into a payload the API handler can use.
:param url: Connection URL to access
:type url: string
:param method: The preferred API Request method (GET, ADD, POST, etc....)
:type method: basestring
:param kwargs: The payload dictionary from the module to be converted.
:return: Properly formatted dictionary payload for API Request via Connection Plugin.
:rtype: dict
"""
params = [{"url": url}]
if args:
for arg in args:
params[0].update(arg)
if kwargs:
keylist = list(kwargs)
for k in keylist:
kwargs[k.replace("__", "-")] = kwargs.pop(k)
if method == "get" or method == "clone":
params[0].update(kwargs)
else:
if kwargs.get("data", False):
params[0]["data"] = kwargs["data"]
else:
params[0]["data"] = kwargs
return params
@staticmethod
def split_comma_strings_into_lists(obj):
"""
Splits a CSV String into a list. Also takes a dictionary, and converts any CSV strings in any key, to a list.
:param obj: object in CSV format to be parsed.
:type obj: str or dict
:return: A list containing the CSV items.
:rtype: list
"""
return_obj = ()
if isinstance(obj, dict):
if len(obj) > 0:
for k, v in obj.items():
if isinstance(v, str):
new_list = list()
if "," in v:
new_items = v.split(",")
for item in new_items:
new_list.append(item.strip())
obj[k] = new_list
return_obj = obj
elif isinstance(obj, str):
return_obj = obj.replace(" ", "").split(",")
return return_obj
@staticmethod
def cidr_to_netmask(cidr):
"""
Converts a CIDR Network string to full blown IP/Subnet format in decimal format.
Decided not use IP Address module to keep includes to a minimum.
:param cidr: String object in CIDR format to be processed
:type cidr: str
:return: A string object that looks like this "x.x.x.x/y.y.y.y"
:rtype: str
"""
if isinstance(cidr, str):
cidr = int(cidr)
mask = (0xFFFFFFFF >> (32 - cidr)) << (32 - cidr)
return (
str((0xFF000000 & mask) >> 24)
+ "."
+ str((0xFF0000 & mask) >> 16)
+ "."
+ str((0x0000FF00 & mask) >> 8)
+ "."
+ str((0x000000FF & mask))
)
@staticmethod
def paramgram_child_list_override(list_overrides, paramgram, module):
"""
If a list of items was provided to a "parent" paramgram attribute, the paramgram needs to be rewritten.
The child keys of the desired attribute need to be deleted, and then that "parent" keys' contents is replaced
With the list of items that was provided.
:param list_overrides: Contains the response from the FortiManager.
:type list_overrides: list
:param paramgram: Contains the paramgram passed to the modules' local modify function.
:type paramgram: dict
:param module: Contains the Ansible Module Object being used by the module.
:type module: classObject
:return: A new "paramgram" refactored to allow for multiple entries being added.
:rtype: dict
"""
if len(list_overrides) > 0:
for list_variable in list_overrides:
try:
list_variable = list_variable.replace("-", "_")
override_data = module.params[list_variable]
if override_data:
del paramgram[list_variable]
paramgram[list_variable] = override_data
except BaseException as e:
raise FMGBaseException(
"Error occurred merging custom lists for the paramgram parent: "
+ str(e)
)
return paramgram
@staticmethod
def syslog(module, msg):
try:
module.log(msg=msg)
except BaseException:
pass
def _report_schema_violation(self, param, schema, detail):
"""
the helper function which fortmats the error message.
:param param: the parameters which are going to be matched.
:type param: dict
:param schema: the schemas which are going to be matched with.
:type schema: dict
:param detail: the hint message which reveals the sort of violation message.
:type detail: string
:return: the status along with formatted error message string
:rtype: tuple
"""
return (
False,
"param:%s does not match schema:%s, detail:%s" % (param, schema, detail),
)
def _validate_param_recursivly(self, param, schema):
"""
the routine which recursively validate the provided parameters and schemas.
:param param: the parameters which are going to be matched.
:type param: dict
:param schema: the schemas which are going to be matched with.
:type schema: dict
:return: the status along with formatted error message string
:rtype: tuple
"""
param_key = None if not isinstance(param, dict) else list(param.keys())[0]
param_value = param if not isinstance(param, dict) else param[param_key]
if "type" not in schema or schema["type"] not in [
"string",
"integer",
"array",
"dict",
]:
if not isinstance(param, dict) or not isinstance(schema, dict):
return self._report_schema_violation(
param, schema, "unrecognized failure"
)
for discrete_param_key in param:
discrete_param_value = param[discrete_param_key]
if discrete_param_key not in schema and (
len(schema) != 1
or not list(schema.keys())[0].startswith("{")
or not list(schema.keys())[0].endswith("}")
):
return self._report_schema_violation(
discrete_param_key, schema, "no available schema found"
)
per_param_schema = schema[list(schema.keys())[0]]
if discrete_param_key in schema:
per_param_schema = schema[discrete_param_key]
result, message = self._validate_param_recursivly(
discrete_param_value, per_param_schema
)
if not result:
return result, message
return True, ""
if schema["type"] == "string":
if not isinstance(param_value, str):
return self._report_schema_violation(param, schema, "type mismatch")
if "enum" in schema and param_value not in schema["enum"]:
return self._report_schema_violation(
param, schema, "enum value mismatch"
)
elif schema["type"] == "integer":
if not isinstance(param_value, int):
return self._report_schema_violation(param, schema, "type mismatch")
if "enum" in schema and param_value not in schema["enum"]:
return self._report_schema_violation(
param, schema, "enum value mismatch"
)
elif schema["type"] == "array":
if "items" not in schema:
raise AssertionError("'items' not in schema:%s" % (schema))
if not isinstance(param_value, list):
return self._report_schema_violation(param, schema, "type mismatch")
for elem in param_value:
result, message = self._validate_param_recursivly(elem, schema["items"])
if not result:
return result, message
elif schema["type"] == "dict":
if not isinstance(param, dict):
return self._report_schema_violation(param, schema, "type mismatch")
if len(list(param.keys())) != 1 or list(param.keys())[0] != schema["name"]:
return self._report_schema_violation(
param, schema, "schema content mismatch"
)
if "dict" not in schema:
raise AssertionError("'dict' not in schema:%s" % (schema))
return self._validate_param_recursivly(
param[schema["name"]], schema["dict"]
)
return True, ""
def _validate_param_block(self, param_block, tagged_schema):
"""
the subordinate routines to validate a tagged parameter block
:param param_block: the tagged parameters block which are going to be matched.
:type param_block: dict
:param tagged_schema: the tagged schemas which are going to be matched with.
:type tagged_schema: dict
:return: the status along with formatted error message string
:rtype: tuple
"""
for param_item_name in param_block:
param_item = {param_item_name: param_block[param_item_name]}
schema_item = None
for schema_desc in tagged_schema:
if schema_desc["name"] == param_item_name:
schema_item = schema_desc
break
if not schema_item:
return False, "unrecognized parameter: %s" % (param_item_name)
result, message = self._validate_param_recursivly(param_item, schema_item)
if not result:
return result, message
return True, "parameter block validation succeeds"
def validate_module_params(self, module, schemas):
"""
the routine to validate input parameters.
:param module: the Ansible module structure.
:type module: AnsibleModule
:param schemas: the schemas which are going to be matched with.
:type schemas: dict
:return: the status along with formatted error message string
:rtype: tuple
"""
method = module.params["method"]
# categorize schema item according to its api_tag.
if method not in schemas["method_mapping"]:
raise FMGBaseException("method:%s not supported in schema" % (method))
schema = schemas["schema_objects"][schemas["method_mapping"][method]]
tagged_schemas = dict()
for item in schema:
if item["name"] == "url":
continue
api_tag = item["api_tag"]
if api_tag not in tagged_schemas:
tagged_schemas[api_tag] = list()
tagged_schemas[api_tag].append(item)
# if no parameters, we skip the validation phase
if not module.params["params"]:
return
for param_block in module.params["params"]:
# in case there are more than one api tag for the url, we check it one by one
# until we encounter an explicit failure
validation_result = False
validation_message = None
for tagged_schema_key in tagged_schemas:
tagged_schema = tagged_schemas[tagged_schema_key]
result, message = self._validate_param_block(param_block, tagged_schema)
validation_result |= result
if not result:
validation_message = message
else:
break
if not validation_result:
raise FMGBaseException(
"parameter validation fails: %s" % (validation_message)
)
def validate_module_url_params(self, module, jrpc_urls, raw_url_schema):
"""
validate whether the given paramters in url match their schema counterpart.
:param module: the Ansible module structure.
:type module: AnsibleModule
:param jrpc_urls: the parameters in url
:type jrpc_urls: list
:param raw_url_schema: the schemas to be matched with.
:type raw_url_schema: list
:return: None
:rtype: Exception maybe raised.
"""
raw_url_params = module.params["url_params"]
# if no url_schema is provided, it's a solo url_no_domain
if not len(raw_url_schema):
if raw_url_params and len(raw_url_params):
raise FMGBaseException("the module expects no url params")
else:
return
url_schema = list()
url_params = dict()
adom_value = "none"
if "adom" in adom_value:
adom_value = raw_url_params["adom"].lower()
if adom_value == "none" or adom_value == "global":
for item in raw_url_schema:
if item["name"] == "adom":
continue
url_schema.append(item)
for param_key in raw_url_params:
if param_key == "adom":
continue
url_params[param_key] = raw_url_params[param_key]
else:
url_schema = raw_url_schema
url_params = raw_url_params
# do legacy validation.
if not len(url_schema):
return
if not url_params or len(url_params) != len(url_schema):
raise FMGBaseException(
"mismatched pameters, full list:%s"
% ([item["name"] for item in url_schema])
)
param_key_set = set(list(url_params.keys()))
schema_key_set = set([item["name"] for item in url_schema])
if param_key_set != schema_key_set:
raise FMGBaseException(
"url parameter %s does not match schema %s"
% (param_key_set, schema_key_set)
)
for param_key in url_params:
param = url_params[param_key]
schema = None
for schema_item in url_schema:
if schema_item["name"] == param_key:
schema = schema_item
break
if not schema:
raise AssertionError("'schema' is None")
if (
schema["type"] == "string"
and not isinstance(param, str)
or schema["type"] == "integer"
and not isinstance(param, int)
):
raise FMGBaseException(
"url parameter %s does not schema %s" % (param, schema)
)
def get_full_url_path(self, module, jrpc_urls):
"""
format the full url string for json-rpc.
:param module: the Ansible module structure.
:type module: AnsibleModule
:param jrpc_urls: the parameters in url
:type jrpc_urls: list
:return: the url string.
:rtype: string
"""
url_params = module.params["url_params"]
url_custom_domain = None
url_global_domain = None
url_no_domain = None
url_format = None
for _url in jrpc_urls:
if "/adom/{adom}/" in _url or _url.endswith("/adom/{adom}"):
url_custom_domain = _url
elif "/global/" in _url:
url_global_domain = _url
else:
url_no_domain = _url
if not url_params or "adom" not in url_params:
url_format = url_no_domain
elif url_params["adom"] == "global":
url_format = url_global_domain
elif url_params["adom"] == "none":
url_format = url_no_domain
else:
url_format = url_custom_domain
if not url_format:
raise AssertionError("'url_format' is None")
return url_format if not url_params else url_format.format(**url_params)
def get_full_payload(self, module, full_url):
"""
construct the full payload including url for json-rpc
:param module: the Ansible module structure.
:type module: AnsibleModule
:param jrpc_urls: the parameters in url
:type jrpc_urls: list
:return: the payload list
:rtype: list
"""
payload_list = list()
params_blocks = module.params["params"]
if params_blocks:
for params_block in params_blocks:
payload = dict()
payload["url"] = full_url
for top_level_param_key in params_block:
top_level_param = params_block[top_level_param_key]
payload[top_level_param_key] = top_level_param
payload_list.append(payload)
else:
# There is one exception that no params is provided, the url is only one in the request
payload_list.append({"url": full_url})
return payload_list
# RECURSIVE FUNCTIONS START
def prepare_dict(obj):
"""
Removes any keys from a dictionary that are only specific to our use in the module. FortiManager will reject
requests with these empty/None keys in it.
:param obj: Dictionary object to be processed.
:type obj: dict
:return: Processed dictionary.
:rtype: dict
"""
list_of_elems = ["mode", "adom", "host", "username", "password"]
if isinstance(obj, dict):
obj = dict(
(key, prepare_dict(value))
for (key, value) in obj.items()
if key not in list_of_elems
)
return obj
def scrub_dict(obj):
"""
Removes any keys from a dictionary that are EMPTY -- this includes parent keys. FortiManager doesn't
like empty keys in dictionaries
:param obj: Dictionary object to be processed.
:type obj: dict
:return: Processed dictionary.
:rtype: dict
"""
if isinstance(obj, dict):
return dict((k, scrub_dict(v)) for k, v in obj.items() if v and scrub_dict(v))
else:
return obj

View File

@@ -0,0 +1,547 @@
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete work.
#
# (c) 2017-2020 Fortinet, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
FMGR_RC,
)
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
FMGBaseException,
)
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
FMGRCommon,
)
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import (
scrub_dict,
)
# check for pyFMG lib - DEPRECATING
try:
from pyFMG.fortimgr import FortiManager
HAS_PYFMGR = True
except ImportError:
HAS_PYFMGR = False
# ACTIVE BUG WITH OUR DEBUG IMPORT CALL -- BECAUSE IT'S UNDER MODULE_UTILITIES
# WHEN module_common.recursive_finder() runs under the module loader, it looks for this namespace debug import
# and because it's not there, it always fails, regardless of it being under a try/catch here.
# we're going to move it to a different namespace.
# # check for debug lib
# try:
# from ansible.module_utils.network.fortimanager.fortimanager_debug import debug_dump
# HAS_FMGR_DEBUG = True
# except:
# HAS_FMGR_DEBUG = False
# BEGIN HANDLER CLASSES
class FortiManagerHandler(object):
def __init__(self, conn, module):
self._conn = conn
self._module = module
self._tools = FMGRCommon
self.process_workspace_lock()
def process_workspace_lock(self):
self._conn.process_workspace_locking(self._module.params)
def process_request(self, url, datagram, method):
"""
Formats and Runs the API Request via Connection Plugin. Streamlined for use FROM Modules.
:param url: Connection URL to access
:type url: string
:param datagram: The prepared payload for the API Request in dictionary format
:type datagram: dict
:param method: The preferred API Request method (GET, ADD, POST, etc....)
:type method: basestring
:return: Dictionary containing results of the API Request via Connection Plugin
:rtype: dict
"""
data = self._tools.format_request(method, url, **datagram)
response = self._conn.send_request(method, data)
# if HAS_FMGR_DEBUG:
# try:
# debug_dump(response, datagram, self._module.paramgram, url, method)
# except BaseException:
# pass
return response
def govern_response(
self,
module,
results,
msg=None,
good_codes=None,
stop_on_fail=None,
stop_on_success=None,
skipped=None,
changed=None,
unreachable=None,
failed=None,
success=None,
changed_if_success=None,
ansible_facts=None,
):
"""
This function will attempt to apply default values to canned responses from FortiManager we know of.
This saves time, and turns the response in the module into a "one-liner", while still giving us...
the flexibility to directly use return_response in modules if we have too. This function saves repeated code.
:param module: The Ansible Module CLASS object, used to run fail/exit json
:type module: object
:param msg: An overridable custom message from the module that called this.
:type msg: string
:param results: A dictionary object containing an API call results
:type results: dict
:param good_codes: A list of exit codes considered successful from FortiManager
:type good_codes: list
:param stop_on_fail: If true, stops playbook run when return code is NOT IN good codes (default: true)
:type stop_on_fail: boolean
:param stop_on_success: If true, stops playbook run when return code is IN good codes (default: false)
:type stop_on_success: boolean
:param changed: If True, tells Ansible that object was changed (default: false)
:type skipped: boolean
:param skipped: If True, tells Ansible that object was skipped (default: false)
:type skipped: boolean
:param unreachable: If True, tells Ansible that object was unreachable (default: false)
:type unreachable: boolean
:param failed: If True, tells Ansible that execution was a failure. Overrides good_codes. (default: false)
:type unreachable: boolean
:param success: If True, tells Ansible that execution was a success. Overrides good_codes. (default: false)
:type unreachable: boolean
:param changed_if_success: If True, defaults to changed if successful if you specify or not"
:type changed_if_success: boolean
:param ansible_facts: A prepared dictionary of ansible facts from the execution.
:type ansible_facts: dict
"""
if module is None and results is None:
raise FMGBaseException(
"govern_response() was called without a module and/or results tuple! Fix!"
)
# Get the Return code from results
try:
rc = results[0]
except BaseException:
raise FMGBaseException(
"govern_response() was called without the return code at results[0]"
)
# init a few items
rc_data = None
# Get the default values for the said return code.
try:
rc_codes = FMGR_RC.get("fmgr_return_codes")
rc_data = rc_codes.get(rc)
except BaseException:
pass
if not rc_data:
rc_data = {}
# ONLY add to overrides if not none -- This is very important that the keys aren't added at this stage
# if they are empty. And there aren't that many, so let's just do a few if then statements.
if good_codes is not None:
rc_data["good_codes"] = good_codes
if stop_on_fail is not None:
rc_data["stop_on_fail"] = stop_on_fail
if stop_on_success is not None:
rc_data["stop_on_success"] = stop_on_success
if skipped is not None:
rc_data["skipped"] = skipped
if changed is not None:
rc_data["changed"] = changed
if unreachable is not None:
rc_data["unreachable"] = unreachable
if failed is not None:
rc_data["failed"] = failed
if success is not None:
rc_data["success"] = success
if changed_if_success is not None:
rc_data["changed_if_success"] = changed_if_success
if results is not None:
rc_data["results"] = results
if msg is not None:
rc_data["msg"] = msg
if ansible_facts is None:
rc_data["ansible_facts"] = {}
else:
rc_data["ansible_facts"] = ansible_facts
return self.return_response(
module=module,
results=results,
msg=rc_data.get("msg", "NULL"),
good_codes=rc_data.get("good_codes", (0,)),
stop_on_fail=rc_data.get("stop_on_fail", True),
stop_on_success=rc_data.get("stop_on_success", False),
skipped=rc_data.get("skipped", False),
changed=rc_data.get("changed", False),
changed_if_success=rc_data.get("changed_if_success", False),
unreachable=rc_data.get("unreachable", False),
failed=rc_data.get("failed", False),
success=rc_data.get("success", False),
ansible_facts=rc_data.get("ansible_facts", dict()),
)
@staticmethod
def return_response(
module,
results,
msg="NULL",
good_codes=(0,),
stop_on_fail=True,
stop_on_success=False,
skipped=False,
changed=False,
unreachable=False,
failed=False,
success=False,
changed_if_success=True,
ansible_facts=(),
):
"""
This function controls the logout and error reporting after an method or function runs. The exit_json for
ansible comes from logic within this function. If this function returns just the msg, it means to continue
execution on the playbook. It is called from the ansible module, or from the self.govern_response function.
:param module: The Ansible Module CLASS object, used to run fail/exit json
:type module: object
:param msg: An overridable custom message from the module that called this.
:type msg: string
:param results: A dictionary object containing an API call results
:type results: dict
:param good_codes: A list of exit codes considered successful from FortiManager
:type good_codes: list
:param stop_on_fail: If true, stops playbook run when return code is NOT IN good codes (default: true)
:type stop_on_fail: boolean
:param stop_on_success: If true, stops playbook run when return code is IN good codes (default: false)
:type stop_on_success: boolean
:param changed: If True, tells Ansible that object was changed (default: false)
:type skipped: boolean
:param skipped: If True, tells Ansible that object was skipped (default: false)
:type skipped: boolean
:param unreachable: If True, tells Ansible that object was unreachable (default: false)
:type unreachable: boolean
:param failed: If True, tells Ansible that execution was a failure. Overrides good_codes. (default: false)
:type unreachable: boolean
:param success: If True, tells Ansible that execution was a success. Overrides good_codes. (default: false)
:type unreachable: boolean
:param changed_if_success: If True, defaults to changed if successful if you specify or not"
:type changed_if_success: boolean
:param ansible_facts: A prepared dictionary of ansible facts from the execution.
:type ansible_facts: dict
:return: A string object that contains an error message
:rtype: str
"""
# VALIDATION ERROR
if (len(results) == 0) or (failed and success) or (changed and unreachable):
module.exit_json(
msg="Handle_response was called with no results, or conflicting failed/success or "
"changed/unreachable parameters. Fix the exit code on module. "
"Generic Failure",
failed=True,
)
# IDENTIFY SUCCESS/FAIL IF NOT DEFINED
if not failed and not success:
if len(results) > 0:
if results[0] not in good_codes:
failed = True
elif results[0] in good_codes:
success = True
if len(results) > 0:
# IF NO MESSAGE WAS SUPPLIED, GET IT FROM THE RESULTS, IF THAT DOESN'T WORK, THEN WRITE AN ERROR MESSAGE
if msg == "NULL":
try:
msg = results[1]["status"]["message"]
except BaseException:
msg = (
"No status message returned at results[1][status][message], "
"and none supplied to msg parameter for handle_response."
)
if failed:
# BECAUSE SKIPPED/FAILED WILL OFTEN OCCUR ON CODES THAT DON'T GET INCLUDED, THEY ARE CONSIDERED FAILURES
# HOWEVER, THEY ARE MUTUALLY EXCLUSIVE, SO IF IT IS MARKED SKIPPED OR UNREACHABLE BY THE MODULE LOGIC
# THEN REMOVE THE FAILED FLAG SO IT DOESN'T OVERRIDE THE DESIRED STATUS OF SKIPPED OR UNREACHABLE.
if failed and skipped:
failed = False
if failed and unreachable:
failed = False
if stop_on_fail:
module.exit_json(
failed=failed,
changed=changed,
unreachable=unreachable,
skipped=skipped,
meta=results[1],
)
elif success:
if changed_if_success:
changed = True
success = False
if stop_on_success:
module.exit_json(
success=success,
changed=changed,
unreachable=unreachable,
skipped=skipped,
meta=results[1],
)
return msg
def construct_ansible_facts(
self, response, ansible_params, paramgram, *args, **kwargs
):
"""
Constructs a dictionary to return to ansible facts, containing various information about the execution.
:param response: Contains the response from the FortiManager.
:type response: dict
:param ansible_params: Contains the parameters Ansible was called with.
:type ansible_params: dict
:param paramgram: Contains the paramgram passed to the modules' local modify function.
:type paramgram: dict
:param args: Free-form arguments that could be added.
:param kwargs: Free-form keyword arguments that could be added.
:return: A dictionary containing lots of information to append to Ansible Facts.
:rtype: dict
"""
facts = {
"response": response,
"ansible_params": scrub_dict(ansible_params),
"paramgram": scrub_dict(paramgram),
"connected_fmgr": self._conn.return_connected_fmgr(),
}
if args:
facts["custom_args"] = args
if kwargs:
facts.update(kwargs)
return facts
##########################
# BEGIN DEPRECATED METHODS
##########################
# SOME OF THIS CODE IS DUPLICATED IN THE PLUGIN, BUT THOSE ARE PLUGIN SPECIFIC. THIS VERSION STILL ALLOWS FOR
# THE USAGE OF PYFMG FOR CUSTOMERS WHO HAVE NOT YET UPGRADED TO ANSIBLE 2.7
# LEGACY PYFMG METHODS START
# USED TO DETERMINE LOCK CONTEXT ON A FORTIMANAGER. A DATABASE LOCKING CONCEPT THAT NEEDS TO BE ACCOUNTED FOR.
class FMGLockContext(object):
"""
- DEPRECATING: USING CONNECTION MANAGER NOW INSTEAD. EVENTUALLY THIS CLASS WILL DISAPPEAR. PLEASE
- CONVERT ALL MODULES TO CONNECTION MANAGER METHOD.
- LEGACY pyFMG HANDLER OBJECT: REQUIRES A CHECK FOR PY FMG AT TOP OF PAGE
"""
def __init__(self, fmg):
self._fmg = fmg
self._locked_adom_list = list()
self._uses_workspace = False
self._uses_adoms = False
@property
def uses_workspace(self):
return self._uses_workspace
@uses_workspace.setter
def uses_workspace(self, val):
self._uses_workspace = val
@property
def uses_adoms(self):
return self._uses_adoms
@uses_adoms.setter
def uses_adoms(self, val):
self._uses_adoms = val
def add_adom_to_lock_list(self, adom):
if adom not in self._locked_adom_list:
self._locked_adom_list.append(adom)
def remove_adom_from_lock_list(self, adom):
if adom in self._locked_adom_list:
self._locked_adom_list.remove(adom)
def check_mode(self):
url = "/cli/global/system/global"
code, resp_obj = self._fmg.get(url, fields=["workspace-mode", "adom-status"])
try:
if resp_obj["workspace-mode"] != 0:
self.uses_workspace = True
except KeyError:
self.uses_workspace = False
try:
if resp_obj["adom-status"] == 1:
self.uses_adoms = True
except KeyError:
self.uses_adoms = False
def run_unlock(self):
for adom_locked in self._locked_adom_list:
self.unlock_adom(adom_locked)
def lock_adom(self, adom=None, *args, **kwargs):
if adom:
if adom.lower() == "global":
url = "/dvmdb/global/workspace/lock/"
else:
url = "/dvmdb/adom/{adom}/workspace/lock/".format(adom=adom)
else:
url = "/dvmdb/adom/root/workspace/lock"
code, respobj = self._fmg.execute(url, {}, *args, **kwargs)
if code == 0 and respobj["status"]["message"].lower() == "ok":
self.add_adom_to_lock_list(adom)
return code, respobj
def unlock_adom(self, adom=None, *args, **kwargs):
if adom:
if adom.lower() == "global":
url = "/dvmdb/global/workspace/unlock/"
else:
url = "/dvmdb/adom/{adom}/workspace/unlock/".format(adom=adom)
else:
url = "/dvmdb/adom/root/workspace/unlock"
code, respobj = self._fmg.execute(url, {}, *args, **kwargs)
if code == 0 and respobj["status"]["message"].lower() == "ok":
self.remove_adom_from_lock_list(adom)
return code, respobj
def commit_changes(self, adom=None, aux=False, *args, **kwargs):
if adom:
if aux:
url = "/pm/config/adom/{adom}/workspace/commit".format(adom=adom)
else:
if adom.lower() == "global":
url = "/dvmdb/global/workspace/commit/"
else:
url = "/dvmdb/adom/{adom}/workspace/commit".format(adom=adom)
else:
url = "/dvmdb/adom/root/workspace/commit"
return self._fmg.execute(url, {}, *args, **kwargs)
# DEPRECATED -- USE PLUGIN INSTEAD
class AnsibleFortiManager(object):
"""
- DEPRECATING: USING CONNECTION MANAGER NOW INSTEAD. EVENTUALLY THIS CLASS WILL DISAPPEAR. PLEASE
- CONVERT ALL MODULES TO CONNECTION MANAGER METHOD.
- LEGACY pyFMG HANDLER OBJECT: REQUIRES A CHECK FOR PY FMG AT TOP OF PAGE
"""
def __init__(
self,
module,
ip=None,
username=None,
passwd=None,
use_ssl=True,
verify_ssl=False,
timeout=300,
):
self.ip = ip
self.username = username
self.passwd = passwd
self.use_ssl = use_ssl
self.verify_ssl = verify_ssl
self.timeout = timeout
self.fmgr_instance = None
if not HAS_PYFMGR:
module.fail_json(
msg="Could not import the python library pyFMG required by this module"
)
self.module = module
def login(self):
if self.ip is not None:
self.fmgr_instance = FortiManager(
self.ip,
self.username,
self.passwd,
use_ssl=self.use_ssl,
verify_ssl=self.verify_ssl,
timeout=self.timeout,
debug=False,
disable_request_warnings=True,
)
return self.fmgr_instance.login()
def logout(self):
if self.fmgr_instance.sid is not None:
self.fmgr_instance.logout()
def get(self, url, data):
return self.fmgr_instance.get(url, **data)
def set(self, url, data):
return self.fmgr_instance.set(url, **data)
def update(self, url, data):
return self.fmgr_instance.update(url, **data)
def delete(self, url, data):
return self.fmgr_instance.delete(url, **data)
def add(self, url, data):
return self.fmgr_instance.add(url, **data)
def execute(self, url, data):
return self.fmgr_instance.execute(url, **data)
def move(self, url, data):
return self.fmgr_instance.move(url, **data)
def clone(self, url, data):
return self.fmgr_instance.clone(url, **data)
##########################
# END DEPRECATED METHODS
##########################

Some files were not shown because too many files have changed in this diff Show More