:source: fortios_wanopt_content_delivery_network_rule.py
:orphan:
.. fortios_wanopt_content_delivery_network_rule:
fortios_wanopt_content_delivery_network_rule -- Configure WAN optimization content delivery network rules in Fortinet's FortiOS and FortiGate.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 2.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify wanopt feature and content_delivery_network_rule category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0
Requirements
------------
The below requirements are needed on the host that executes this module.
- ansible>=2.16
Tips
----
Using member operation to add an element to an existing object.
FortiOS Version Compatibility
-----------------------------
Supported Version Ranges: v6.0.0 -> v7.6.6
Parameters
----------
.. raw:: html
- access_token - Token-based authentication. Generated from GUI of Fortigate. type: str required: false
- enable_log - Enable/Disable logging for task. type: bool required: false default: False
- vdom - Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. type: str default: root
- member_path - Member attribute path to operate on. type: str
- member_state - Add or delete a member under specified attribute path. type: str choices: present, absent
- state - Indicates whether to create or remove the object. type: str required: true choices: present, absent
- wanopt_content_delivery_network_rule - Configure WAN optimization content delivery network rules. type: dict
more...
| Supported Version Ranges |
| wanopt_content_delivery_network_rule |
v6.0.0 -> 7.6.6 |
- category - Content delivery network rule category. type: str choices: vcache, youtube
more...
|
Supported Version Ranges |
| category |
v6.0.0 -> 7.6.6 |
| [vcache] |
v6.0.0 -> 7.6.6 |
| [youtube] |
v6.0.0 -> 7.6.6 |
- comment - Comment about this CDN-rule. type: str
more...
|
Supported Version Ranges |
| comment |
v6.0.0 -> 7.6.6 |
- host_domain_name_suffix - Suffix portion of the fully qualified domain name. For example, fortinet.com in "www.fortinet.com". type: list member_path: host_domain_name_suffix:name
more...
| Supported Version Ranges |
| host_domain_name_suffix |
v6.0.0 -> 7.6.6 |
- name - Suffix portion of the fully qualified domain name. type: str required: true
more...
|
Supported Version Ranges |
| name |
v6.0.0 -> 7.6.6 |
- name - Name of table. type: str required: true
more...
|
Supported Version Ranges |
| name |
v6.0.0 -> 7.6.6 |
- request_cache_control - Enable/disable HTTP request cache control. type: str choices: enable, disable
more...
|
Supported Version Ranges |
| request_cache_control |
v6.0.0 -> 7.6.6 |
| [enable] |
v6.0.0 -> 7.6.6 |
| [disable] |
v6.0.0 -> 7.6.6 |
- response_cache_control - Enable/disable HTTP response cache control. type: str choices: enable, disable
more...
|
Supported Version Ranges |
| response_cache_control |
v6.0.0 -> 7.6.6 |
| [enable] |
v6.0.0 -> 7.6.6 |
| [disable] |
v6.0.0 -> 7.6.6 |
- response_expires - Enable/disable HTTP response cache expires. type: str choices: enable, disable
more...
|
Supported Version Ranges |
| response_expires |
v6.0.0 -> 7.6.6 |
| [enable] |
v6.0.0 -> 7.6.6 |
| [disable] |
v6.0.0 -> 7.6.6 |
- rules - WAN optimization content delivery network rule entries. type: list member_path: rules:name
more...
| Supported Version Ranges |
| rules |
v6.0.0 -> 7.6.6 |
- content_id - Content ID settings. type: dict
more...
| Supported Version Ranges |
| content_id |
v6.0.0 -> 7.6.6 |
- end_direction - Search direction from end-str match. type: str choices: forward, backward
more...
|
Supported Version Ranges |
| end_direction |
v6.0.0 -> 7.6.6 |
| [forward] |
v6.0.0 -> 7.6.6 |
| [backward] |
v6.0.0 -> 7.6.6 |
- end_skip - Number of characters in URL to skip after end-str has been matched. type: int
more...
|
Supported Version Ranges |
| end_skip |
v6.0.0 -> 7.6.6 |
- end_str - String from which to end search. type: str
more...
|
Supported Version Ranges |
| end_str |
v6.0.0 -> 7.6.6 |
- range_str - Name of content ID within the start string and end string. type: str
more...
|
Supported Version Ranges |
| range_str |
v6.0.0 -> 7.6.6 |
- start_direction - Search direction from start-str match. type: str choices: forward, backward
more...
|
Supported Version Ranges |
| start_direction |
v6.0.0 -> 7.6.6 |
| [forward] |
v6.0.0 -> 7.6.6 |
| [backward] |
v6.0.0 -> 7.6.6 |
- start_skip - Number of characters in URL to skip after start-str has been matched. type: int
more...
|
Supported Version Ranges |
| start_skip |
v6.0.0 -> 7.6.6 |
- start_str - String from which to start search. type: str
more...
|
Supported Version Ranges |
| start_str |
v6.0.0 -> 7.6.6 |
- target - Option in HTTP header or URL parameter to match. type: str choices: path, parameter, referrer, youtube-map, youtube-id, youku-id, hls-manifest, dash-manifest, hls-fragment, dash-fragment
more...
|
Supported Version Ranges |
| target |
v6.0.0 -> 7.6.6 |
| [path] |
v6.0.0 -> 7.6.6 |
| [parameter] |
v6.0.0 -> 7.6.6 |
| [referrer] |
v6.0.0 -> 7.6.6 |
| [youtube-map] |
v6.0.0 -> 7.6.6 |
| [youtube-id] |
v6.0.0 -> 7.6.6 |
| [youku-id] |
v6.0.0 -> 7.6.6 |
| [hls-manifest] |
v6.0.0 -> 7.6.6 |
| [dash-manifest] |
v6.0.0 -> 7.6.6 |
| [hls-fragment] |
v6.0.0 -> 7.6.6 |
| [dash-fragment] |
v6.0.0 -> 7.6.6 |
- match_entries - List of entries to match. type: list member_path: rules:name/match_entries:id
more...
| Supported Version Ranges |
| match_entries |
v6.0.0 -> 7.6.6 |
- id - Rule ID. see Notes. type: int required: true
more...
|
Supported Version Ranges |
| id |
v6.0.0 -> 7.6.6 |
- pattern - Pattern string for matching target (Referrer or URL pattern). For example, a, a*c, *a*, a*c*e, and *. type: list member_path: rules:name/match_entries:id/pattern:string
more...
| Supported Version Ranges |
| pattern |
v6.0.0 -> 7.6.6 |
- string - Pattern strings. type: str required: true
more...
|
Supported Version Ranges |
| string |
v6.0.0 -> 7.6.6 |
- target - Option in HTTP header or URL parameter to match. type: str choices: path, parameter, referrer, youtube-map, youtube-id, youku-id
more...
|
Supported Version Ranges |
| target |
v6.0.0 -> 7.6.6 |
| [path] |
v6.0.0 -> 7.6.6 |
| [parameter] |
v6.0.0 -> 7.6.6 |
| [referrer] |
v6.0.0 -> 7.6.6 |
| [youtube-map] |
v6.0.0 -> 7.6.6 |
| [youtube-id] |
v6.0.0 -> 7.6.6 |
| [youku-id] |
v6.0.0 -> 7.6.6 |
- match_mode - Match criteria for collecting content ID. type: str choices: all, any
more...
|
Supported Version Ranges |
| match_mode |
v6.0.0 -> 7.6.6 |
| [all] |
v6.0.0 -> 7.6.6 |
| [any] |
v6.0.0 -> 7.6.6 |
- name - WAN optimization content delivery network rule name. type: str required: true
more...
|
Supported Version Ranges |
| name |
v6.0.0 -> 7.6.6 |
- skip_entries - List of entries to skip. type: list member_path: rules:name/skip_entries:id
more...
| Supported Version Ranges |
| skip_entries |
v6.0.0 -> 7.6.6 |
- id - Rule ID. see Notes. type: int required: true
more...
|
Supported Version Ranges |
| id |
v6.0.0 -> 7.6.6 |
- pattern - Pattern string for matching target (Referrer or URL pattern). For example, a, a*c, *a*, a*c*e, and *. type: list member_path: rules:name/skip_entries:id/pattern:string
more...
| Supported Version Ranges |
| pattern |
v6.0.0 -> 7.6.6 |
- string - Pattern strings. type: str required: true
more...
|
Supported Version Ranges |
| string |
v6.0.0 -> 7.6.6 |
- target - Option in HTTP header or URL parameter to match. type: str choices: path, parameter, referrer, youtube-map, youtube-id, youku-id
more...
|
Supported Version Ranges |
| target |
v6.0.0 -> 7.6.6 |
| [path] |
v6.0.0 -> 7.6.6 |
| [parameter] |
v6.0.0 -> 7.6.6 |
| [referrer] |
v6.0.0 -> 7.6.6 |
| [youtube-map] |
v6.0.0 -> 7.6.6 |
| [youtube-id] |
v6.0.0 -> 7.6.6 |
| [youku-id] |
v6.0.0 -> 7.6.6 |
- skip_rule_mode - Skip mode when evaluating skip-rules. type: str choices: all, any
more...
|
Supported Version Ranges |
| skip_rule_mode |
v6.0.0 -> 7.6.6 |
| [all] |
v6.0.0 -> 7.6.6 |
| [any] |
v6.0.0 -> 7.6.6 |
- status - Enable/disable WAN optimization content delivery network rules. type: str choices: enable, disable
more...
|
Supported Version Ranges |
| status |
v6.0.0 -> 7.6.6 |
| [enable] |
v6.0.0 -> 7.6.6 |
| [disable] |
v6.0.0 -> 7.6.6 |
- text_response_vcache - Enable/disable caching of text responses. type: str choices: enable, disable
more...
|
Supported Version Ranges |
| text_response_vcache |
v6.0.0 -> v6.0.11 |
v6.2.3 -> v6.2.3 |
| [enable] |
v6.0.0 -> v6.0.11 |
| [disable] |
v6.0.0 -> v6.0.11 |
- updateserver - Enable/disable update server. type: str choices: enable, disable
more...
|
Supported Version Ranges |
| updateserver |
v6.0.0 -> 7.6.6 |
| [enable] |
v6.0.0 -> 7.6.6 |
| [disable] |
v6.0.0 -> 7.6.6 |
Notes
-----
.. note::
- Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
- The module supports check_mode.
Examples
--------
.. code-block:: yaml+jinja
- name: Configure WAN optimization content delivery network rules.
fortinet.fortios.fortios_wanopt_content_delivery_network_rule:
vdom: "{{ vdom }}"
state: "present"
access_token: ""
wanopt_content_delivery_network_rule:
category: "vcache"
comment: "Comment about this CDN-rule."
host_domain_name_suffix:
-
name: "default_name_6"
name: "default_name_7"
request_cache_control: "enable"
response_cache_control: "enable"
response_expires: "enable"
rules:
-
content_id:
end_direction: "forward"
end_skip: "0"
end_str: ""
range_str: ""
start_direction: "forward"
start_skip: "0"
start_str: ""
target: "path"
match_entries:
-
id: "22"
pattern:
-
string: ""
target: "path"
match_mode: "all"
name: "default_name_27"
skip_entries:
-
id: "29"
pattern:
-
string: ""
target: "path"
skip_rule_mode: "all"
status: "enable"
text_response_vcache: "enable"
updateserver: "enable"
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
- build - Build number of the fortigate image returned: always type: str sample: 1547
- http_method - Last method used to provision the content into FortiGate returned: always type: str sample: PUT
- http_status - Last result given by FortiGate on last operation applied returned: always type: str sample: 200
- mkey - Master key (id) used in the last call to FortiGate returned: success type: str sample: id
- name - Name of the table used to fulfill the request returned: always type: str sample: urlfilter
- path - Path of the table used to fulfill the request returned: always type: str sample: webfilter
- revision - Internal revision number returned: always type: str sample: 17.0.2.10658
- serial - Serial number of the unit returned: always type: str sample: FGVMEVYYQT3AB5352
- status - Indication of the operation's result returned: always type: str sample: success
- vdom - Virtual domain used returned: always type: str sample: root
- version - Version of the FortiGate returned: always type: str sample: v5.6.3
Status
------
- This module is not guaranteed to have a backwards compatible interface.
Authors
-------
- Link Zheng (@chillancezen)
- Jie Xue (@JieX19)
- Hongbin Lu (@fgtdev-hblu)
- Frank Shen (@frankshen01)
- Miguel Angel Munoz (@mamunozgonzalez)
- Nicolas Thomas (@thomnico)
.. hint::
If you notice any issues in this documentation, you can create a pull request to improve it.