chillancezen.fortimanager.fmgr_securityconsole_install_package (2.1.6) — module

no description

| "added in version" 1.0.0 of chillancezen.fortimanager"

Authors: Link Zheng (@chillancezen), Jie Xue (@JieX19), Frank Shen (@fshen01), Hongbin Lu (@fgtdev-hblu)

preview | supported by community

Install collection

Install with ansible-galaxy collection install chillancezen.fortimanager:==2.1.6


Add to requirements.yml

  collections:
    - name: chillancezen.fortimanager
      version: 2.1.6

Description

This module is able to configure a FortiManager device.

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
 - name: INSTALL PREVIEW - POLICY PACKAGE
   hosts: fmg
   connection: httpapi
   collections: fortinet.fortimanager
   vars:
     adom: demo
     ppkg: ppkg_hubs
     device: fgt_00_1
   tasks:
     - name: Install for policy package {{ adom }}/{{ ppkg }} [preview mode]
       fmgr_securityconsole_install_package:
         securityconsole_install_package:
           adom: "{{ adom }}"
           flags:
              - preview
           pkg: "{{ ppkg }}"
           scope:
             - name: "{{ device }}"
               vdom: root
       register: r
     - name: Poll the task
       fmgr_fact:
         facts:
           selector: 'task_task'
           params:
             task: '{{ r.meta.response_data.task }}'
       register: taskinfo
       until: taskinfo.meta.response_data.percent == 100
       retries: 30
       delay: 5
     - name: Trigger the preview report generation for policy package {{ adom }}/{{ ppkg }}
       fmgr_securityconsole_install_preview:
         securityconsole_install_preview:
           adom: "{{ adom }}"
           device: "{{ device }}"
           flags:
             - json
           vdoms: root
       register: r
     - name: Poll the task
       fmgr_fact:
         facts:
           selector: 'task_task'
           params:
             task: '{{ r.meta.response_data.task }}'
       register: taskinfo
       until: taskinfo.meta.response_data.percent == 100
       retries: 30
       delay: 5
     - name: Get the preview report for policy package {{ adom }}/{{ ppkg }}
       fmgr_securityconsole_preview_result:
         securityconsole_preview_result:
            adom: "{{ adom }}"
            device: "{{ device }}"
       register: r
     - name: Cancel install task for policy package {{ adom }}/{{ ppkg }}
       fmgr_securityconsole_package_cancel_install:
         securityconsole_package_cancel_install:
           adom: "{{ adom }}"
     - name: Show preview report
       debug:
         msg: "{{ r }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
 - hosts: fortimanager00
   collections:
     - fortinet.fortimanager
   connection: httpapi
   vars:
      ansible_httpapi_use_ssl: True
      ansible_httpapi_validate_certs: False
      ansible_httpapi_port: 443
   tasks:
    - name: Copy and install a policy package to devices.
      fmgr_securityconsole_install_package:
         bypass_validation: False
         securityconsole_install_package:
            adom: ansible
            adom_rev_comments: ansible-comment
            adom_rev_name: ansible-test
            dev_rev_comments: ansible-comment
            flags:
              - none
              - cp_all_objs
              - preview
              - generate_rev
              - copy_assigned_pkg
              - unassign
              - ifpolicy_only
              - no_ifpolicy
              - objs_only
              - auto_lock_ws
              - check_pkg_st
              - copy_only
            pkg: ansible
            scope:
              -
                  name: ansible-test
                  vdom: root

Outputs

request_url:
  description: The full url requested
  returned: always
  sample: /sys/login/user
  type: str
response_code:
  description: The status of api request
  returned: always
  sample: 0
  type: int
response_message:
  description: The descriptive message of the api response
  returned: always
  sample: OK.
  type: str