:source: fortiswitch_json_generic.py :orphan: .. : .. _fortiswitch_json_generic: fortiswitch_json_generic -- Configure Fortinet's FortiSwitch with json generic method. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. contents:: :local: :depth: 1 Synopsis -------- This module is able to configure a FortiSwitch device by allowing the user to set any category supported by FortiAPI with raw json. All parameters and values included in examples need to be adjusted to datasources before usage. Requirements ------------- The below requirements are needed on the host that executes this module. - install galaxy collection ``fortinet.fortiswitch`` >= 1.2.5 Parameters ---------- .. raw:: html Examples -------- **host** .. code-block:: yaml+jinja [fortiswitches] fortiswitch01 ansible_host=192.168.52.177 ansible_user="admin" ansible_password="your_password" [fortiswitches:vars] ansible_network_os=fortinet.fortiswitch.fortiswitch **sample1.yml** .. code-block:: yaml+jinja --- - hosts: fortiswitches connection: httpapi collections: - fortinet.fortiswitch vars: ansible_httpapi_use_ssl: true ansible_httpapi_validate_certs: false ansible_httpapi_port: 443 tasks: - name: test add with string fortiswitch_json_generic: enable_log: True json_generic: method: "PUT" path: "/api/v2/cmdb/system/global" jsonbody: | { "timezone": "04" } register: info - name: display vars debug: msg="{{info}}" 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: .. raw:: html Authors ------- - Link Zheng (@chillancezen) - Jie Xue (@JieX19) - Frank Shen (@fshen01) - Hongbin Lu (@fgtdev-hblu) Warning ------- It's preferred to use ``FortiSwitch Ansible Collection Included Modules`` unless some features are not available there.