faz_rename – Rename An Object.

New in version 1.0.0.

Synopsis

  • This module is able to configure a FortiAnalyzer device.

  • Examples include all parameters and values need to be adjusted to data sources before usage.

  • Tested with FortiAnalyzer v6.x and v7.x.

Requirements

The below requirements are needed on the host that executes this module.

  • ansible>=2.15.0

Parameters

  • access_token -The token to access FortiAnalyzer without using ansible_username and ansible_password. type: str required: false
  • enable_log - Enable/Disable logging for task type: bool required: false default: False
  • forticloud_access_token - Access token of forticloud analyzer API users. type: str required: false
  • log_path - The path to save log. Used if enable_log is true. Please use absolute path instead of relative path. If the log_path setting is incorrect, the log will be saved in /tmp/fortianalyzer.ansible.logtype: str required: false default: "/tmp/fortianalyzer.ansible.log"
  • rc_succeeded - The rc codes list with which the conditions to succeed will be overriden type: list required: false
  • rc_failed - The rc codes list with which the conditions to fail will be overriden type: list required: false
  • rename - Rename An Object. type: dict
    • target - Attribute to override for target object. type: dict required: true
    • selector - selector of the renamed object type: str choices:
      • cli_fmupdate_fdssetting_pushoverridetoclient_announceip - available versions: >= 6.2.1
      • cli_fmupdate_fdssetting_serveroverride_servlist - available versions: >= 6.2.1
      • cli_fmupdate_serveraccesspriorities_privateserver - available versions: >= 6.2.1
      • cli_fmupdate_webspam_fgdsetting_serveroverride_servlist - available versions: >= 6.2.1
      • cli_system_admin_group - available versions: >= 6.2.1
      • cli_system_admin_group_member - available versions: >= 6.2.1
      • cli_system_admin_ldap - available versions: >= 6.2.1
      • cli_system_admin_radius - available versions: >= 6.2.1
      • cli_system_admin_tacacs - available versions: >= 6.2.1
      • cli_system_admin_user - available versions: >= 6.2.1
      • cli_system_admin_user_adom - available versions: >= 6.2.1
      • cli_system_admin_user_adomexclude - available versions: 6.2.1-7.0.2
      • cli_system_admin_user_dashboard - available versions: >= 6.2.1
      • cli_system_admin_user_dashboardtabs - available versions: >= 6.2.1
      • cli_system_admin_user_metadata - available versions: >= 6.2.1
      • cli_system_admin_user_policypackage - available versions: >= 6.2.1
      • cli_system_admin_user_restrictdevvdom - available versions: 6.2.1-6.2.3
      • cli_system_alertevent - available versions: >= 6.2.1
      • cli_system_certificate_ca - available versions: >= 6.2.1
      • cli_system_certificate_crl - available versions: >= 6.2.1
      • cli_system_certificate_local - available versions: >= 6.2.1
      • cli_system_certificate_remote - available versions: >= 6.2.1
      • cli_system_certificate_ssh - available versions: >= 6.2.1
      • cli_system_csf_trustedlist - available versions: >= 7.4.1
      • cli_system_ha_peer - available versions: >= 6.2.1
      • cli_system_ha_privatepeer - available versions: >= 6.2.1
      • cli_system_ha_vip - available versions: >= 7.0.5
      • cli_system_interface - available versions: >= 6.2.1
      • cli_system_localinpolicy - available versions: >= 7.2.0
      • cli_system_localinpolicy6 - available versions: >= 7.2.0
      • cli_system_log_devicedisable - available versions: >= 6.4.4
      • cli_system_log_maildomain - available versions: >= 6.2.1
      • cli_system_log_ratelimit_device - available versions: 6.4.8-7.0.2
      • cli_system_log_ratelimit_ratelimits - available versions: >= 7.0.3
      • cli_system_logfetch_clientprofile - available versions: >= 6.2.1
      • cli_system_logfetch_clientprofile_devicefilter - available versions: >= 6.2.1
      • cli_system_logfetch_clientprofile_logfilter - available versions: >= 6.2.1
      • cli_system_logforward - available versions: >= 6.2.1
      • cli_system_logforward_devicefilter - available versions: >= 6.2.1
      • cli_system_logforward_logfieldexclusion - available versions: >= 6.2.1
      • cli_system_logforward_logfilter - available versions: >= 6.2.1
      • cli_system_logforward_logmaskingcustom - available versions: >= 7.0.0
      • cli_system_mail - available versions: >= 6.2.1
      • cli_system_metadata_admins - available versions: >= 6.2.1
      • cli_system_ntp_ntpserver - available versions: >= 6.2.1
      • cli_system_report_group - available versions: >= 6.2.1
      • cli_system_route - available versions: >= 6.2.1
      • cli_system_route6 - available versions: >= 6.2.1
      • cli_system_saml_fabricidp - available versions: 6.2.1-6.2.1, >= 6.4.1
      • cli_system_saml_serviceproviders - available versions: >= 6.2.1
      • cli_system_sniffer - available versions: >= 6.2.1
      • cli_system_snmp_community - available versions: >= 6.2.1
      • cli_system_snmp_community_hosts - available versions: >= 6.2.1
      • cli_system_snmp_community_hosts6 - available versions: >= 6.2.1
      • cli_system_snmp_user - available versions: >= 6.2.1
      • cli_system_socfabric_trustedlist - available versions: >= 7.4.0
      • cli_system_sql_customindex - available versions: >= 6.2.1
      • cli_system_sql_customskipidx - available versions: 6.2.1-6.2.1, >= 6.2.3
      • cli_system_sql_tsindexfield - available versions: >= 6.2.1
      • cli_system_syslog - available versions: >= 6.2.1
      • cli_system_workflow_approvalmatrix - available versions: 6.2.1-6.2.9, 6.4.1-6.4.7, 7.0.0-7.0.2
      • dvmdb_adom - available versions: >= 6.2.1
      • dvmdb_device_vdom - available versions: >= 6.2.1
      • dvmdb_folder - available versions: >= 6.4.2
      • dvmdb_group - available versions: >= 6.2.1
    • self - the parameter for each selector type: dict choices:
      • params for cli_fmupdate_fdssetting_pushoverridetoclient_announceip:
        • announce-ip
      • params for cli_fmupdate_fdssetting_serveroverride_servlist:
        • servlist
      • params for cli_fmupdate_serveraccesspriorities_privateserver:
        • private-server
      • params for cli_fmupdate_webspam_fgdsetting_serveroverride_servlist:
        • servlist
      • params for cli_system_admin_group:
        • group
      • params for cli_system_admin_group_member:
        • group
        • member
      • params for cli_system_admin_ldap:
        • ldap
      • params for cli_system_admin_radius:
        • radius
      • params for cli_system_admin_tacacs:
        • tacacs
      • params for cli_system_admin_user:
        • user
      • params for cli_system_admin_user_adom:
        • adom
        • user
      • params for cli_system_admin_user_adomexclude:
        • adom-exclude
        • user
      • params for cli_system_admin_user_dashboard:
        • dashboard
        • user
      • params for cli_system_admin_user_dashboardtabs:
        • dashboard-tabs
        • user
      • params for cli_system_admin_user_metadata:
        • meta-data
        • user
      • params for cli_system_admin_user_policypackage:
        • policy-package
        • user
      • params for cli_system_admin_user_restrictdevvdom:
        • restrict-dev-vdom
        • user
      • params for cli_system_alertevent:
        • alert-event
      • params for cli_system_certificate_ca:
        • ca
      • params for cli_system_certificate_crl:
        • crl
      • params for cli_system_certificate_local:
        • local
      • params for cli_system_certificate_remote:
        • remote
      • params for cli_system_certificate_ssh:
        • ssh
      • params for cli_system_csf_trustedlist:
        • trusted-list
      • params for cli_system_ha_peer:
        • peer
      • params for cli_system_ha_privatepeer:
        • private-peer
      • params for cli_system_ha_vip:
        • vip
      • params for cli_system_interface:
        • interface
      • params for cli_system_localinpolicy:
        • local-in-policy
      • params for cli_system_localinpolicy6:
        • local-in-policy6
      • params for cli_system_log_devicedisable:
        • device-disable
      • params for cli_system_log_maildomain:
        • mail-domain
      • params for cli_system_log_ratelimit_device:
        • device
      • params for cli_system_log_ratelimit_ratelimits:
        • ratelimits
      • params for cli_system_logfetch_clientprofile:
        • client-profile
      • params for cli_system_logfetch_clientprofile_devicefilter:
        • client-profile
        • device-filter
      • params for cli_system_logfetch_clientprofile_logfilter:
        • client-profile
        • log-filter
      • params for cli_system_logforward:
        • log-forward
      • params for cli_system_logforward_devicefilter:
        • device-filter
        • log-forward
      • params for cli_system_logforward_logfieldexclusion:
        • log-field-exclusion
        • log-forward
      • params for cli_system_logforward_logfilter:
        • log-filter
        • log-forward
      • params for cli_system_logforward_logmaskingcustom:
        • log-forward
        • log-masking-custom
      • params for cli_system_mail:
        • mail
      • params for cli_system_metadata_admins:
        • admins
      • params for cli_system_ntp_ntpserver:
        • ntpserver
      • params for cli_system_report_group:
        • group
      • params for cli_system_route:
        • route
      • params for cli_system_route6:
        • route6
      • params for cli_system_saml_fabricidp:
        • fabric-idp
      • params for cli_system_saml_serviceproviders:
        • service-providers
      • params for cli_system_sniffer:
        • sniffer
      • params for cli_system_snmp_community:
        • community
      • params for cli_system_snmp_community_hosts:
        • community
        • hosts
      • params for cli_system_snmp_community_hosts6:
        • community
        • hosts6
      • params for cli_system_snmp_user:
        • user
      • params for cli_system_socfabric_trustedlist:
        • trusted-list
      • params for cli_system_sql_customindex:
        • custom-index
      • params for cli_system_sql_customskipidx:
        • custom-skipidx
      • params for cli_system_sql_tsindexfield:
        • ts-index-field
      • params for cli_system_syslog:
        • syslog
      • params for cli_system_workflow_approvalmatrix:
        • approval-matrix
      • params for dvmdb_adom:
        • adom
      • params for dvmdb_device_vdom:
        • adom
        • device
        • vdom
      • params for dvmdb_folder:
        • adom
        • folder
      • params for dvmdb_group:
        • adom
        • group

Notes

Note

  • Selector is a mandatory parameter for the module, and the params is varying depending on the selector.

  • Semantic description for the module: rename self as new target

  • Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded

Examples

- name: Rename a resource.
  connection: httpapi
  hosts: fortianalyzers
  vars:
    ansible_httpapi_port: 443
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
  tasks:
    - name: Create device group table.
      fortinet.fortianalyzer.faz_dvmdb_group:
        adom: root
        dvmdb_group:
          name: foogroup
          os_type: unknown
          type: normal
        state: present
    - name: Rename device group table.
      fortinet.fortianalyzer.faz_rename:
        rename:
          selector: dvmdb_group
          self:
            adom: root
            group: foogroup
          target:
            name: "foogroup_renamed"
    - name: Get device group table information.
      fortinet.fortianalyzer.faz_fact:
        facts:
          selector: dvmdb_group
          params:
            adom: root
            group: foogroup
      register: info
      failed_when: info.rc == 0
    - name: Delete device group table.
      fortinet.fortianalyzer.faz_dvmdb_group:
        adom: root
        state: absent
        dvmdb_group:
          name: foogroup_renamed

Return Values

Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:

  • meta - The result of the request. returned: always type: dict
    • request_url - The full url requested. returned: always type: str sample: /sys/login/user
    • response_code - The status of api request. returned: always type: int sample: 0
    • response_data - The data body of the api response. returned: optional type: list or dict
    • response_message - The descriptive message of the api response. returned: always type: str sample: OK
    • system_information - The information of the target system. returned: always type: dict
  • rc - The status the request. returned: always type: int sample: 0
  • version_check_warning - Warning if the parameters used in the playbook are not supported by the current fortianalyzer version. returned: if params are not supported in the current version type: list

Status

  • This module is not guaranteed to have a backwards compatible interface.

Authors

  • Xinwei Du (@dux-fortinet)

  • Link Zheng (@chillancezen)

  • Jie Xue (@JieX19)

  • Frank Shen (@fshen01)

  • Hongbin Lu (@fgtdev-hblu)

Hint

If you notice any issues in this documentation, you can create a pull request to improve it.