-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfmgr_script_create.yml
39 lines (39 loc) · 1.11 KB
/
fmgr_script_create.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
- name: FortiManager Scripting
hosts: myfortimanagers
gather_facts: no
connection: httpapi
collections:
- fortinet.fortimanager
vars:
ansible_httpapi_use_ssl: True
ansible_httpapi_validate_certs: False
ansible_httpapi_port: 443
script_name: demoscript
tasks:
- name: create the script
fmgr_dvmdb_script:
method: set
url_params:
adom: root
params:
- data:
- name: "{{ script_name }}"
type: 'cli'
target: remote_device
content: |
config system ntp
set type custom
set syncinterval 20
config ntpserver
edit 1
set server "10.210.1.1"
next
end
set source-ip 192.168.122.40
end
register: created_script
- name: examine the result
fail:
msg: 'the script is not created'
failed_when:
- created_script.meta.status.code != 0