summaryrefslogtreecommitdiffstats
path: root/ansible_collections/fortinet/fortios/examples
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:03:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:03:42 +0000
commit66cec45960ce1d9c794e9399de15c138acb18aed (patch)
tree59cd19d69e9d56b7989b080da7c20ef1a3fe2a5a /ansible_collections/fortinet/fortios/examples
parentInitial commit. (diff)
downloadansible-upstream.tar.xz
ansible-upstream.zip
Adding upstream version 7.3.0+dfsg.upstream/7.3.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/fortinet/fortios/examples')
-rw-r--r--ansible_collections/fortinet/fortios/examples/httpapi/inventory/hosts5
-rw-r--r--ansible_collections/fortinet/fortios/examples/httpapi/readme2
-rw-r--r--ansible_collections/fortinet/fortios/examples/httpapi/set_system_global.yml19
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_firewall_address.yml27
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_firewall_address_group.yml25
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_firewall_vip.yml27
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_system_alias.yml23
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_system_dns.yml21
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_system_global.yml24
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_system_ha.yml24
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_system_ha_monitor.yml21
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_system_ntp.yml22
-rw-r--r--ansible_collections/fortinet/fortios/examples/set_system_zone.yml27
13 files changed, 267 insertions, 0 deletions
diff --git a/ansible_collections/fortinet/fortios/examples/httpapi/inventory/hosts b/ansible_collections/fortinet/fortios/examples/httpapi/inventory/hosts
new file mode 100644
index 00000000..b09d12e9
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/httpapi/inventory/hosts
@@ -0,0 +1,5 @@
+[fortigates]
+fortigate01 ansible_host=192.168.52.177 ansible_user="admin" ansible_password="admin"
+
+[fortigates:vars]
+ansible_network_os=fortinet.fortios.fortios
diff --git a/ansible_collections/fortinet/fortios/examples/httpapi/readme b/ansible_collections/fortinet/fortios/examples/httpapi/readme
new file mode 100644
index 00000000..071e08ce
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/httpapi/readme
@@ -0,0 +1,2 @@
+Usage:
+# ansible-playbook set_system_global.yml -i inventory/hosts
diff --git a/ansible_collections/fortinet/fortios/examples/httpapi/set_system_global.yml b/ansible_collections/fortinet/fortios/examples/httpapi/set_system_global.yml
new file mode 100644
index 00000000..4b4b3d09
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/httpapi/set_system_global.yml
@@ -0,0 +1,19 @@
+---
+- hosts: fortigates
+ collections:
+ - fortinet.fortios
+ connection: httpapi
+ vars:
+ vdom: "root"
+ ansible_httpapi_use_ssl: yes
+ ansible_httpapi_validate_certs: no
+ ansible_httpapi_port: 443
+ tasks:
+ - name: Configure global attributes.
+ fortios_system_global:
+ vdom: "{{ vdom }}"
+ system_global:
+ admintimeout: "23"
+ hostname: "FortiGate11"
+ admin_lockout_threshold: "8"
+ admin_login_max: "9"
diff --git a/ansible_collections/fortinet/fortios/examples/set_firewall_address.yml b/ansible_collections/fortinet/fortios/examples/set_firewall_address.yml
new file mode 100644
index 00000000..b2eb5b86
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_firewall_address.yml
@@ -0,0 +1,27 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure IPv4 addresses.
+ fortios_firewall_address:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ state: "present"
+ firewall_address:
+ allow_routing: "enable"
+ comment: "Comment."
+ name: "testfwaddr"
+ start_ip: "1.1.1.1"
+ end_ip: "1.1.1.2"
+ type: "iprange" \ No newline at end of file
diff --git a/ansible_collections/fortinet/fortios/examples/set_firewall_address_group.yml b/ansible_collections/fortinet/fortios/examples/set_firewall_address_group.yml
new file mode 100644
index 00000000..1c9c2b82
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_firewall_address_group.yml
@@ -0,0 +1,25 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure IPv4 address groups.
+ fortios_firewall_addrgrp:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ state: "present"
+ firewall_addrgrp:
+ name: "testfwgrp"
+ member:
+ -
+ name: "SSLVPN_TUNNEL_ADDR1"
diff --git a/ansible_collections/fortinet/fortios/examples/set_firewall_vip.yml b/ansible_collections/fortinet/fortios/examples/set_firewall_vip.yml
new file mode 100644
index 00000000..3637d39c
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_firewall_vip.yml
@@ -0,0 +1,27 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure virtual IP for IPv4.
+ fortios_firewall_vip:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ state: "present"
+ firewall_vip:
+ name: "testfwvip"
+ extip: "1.1.1.1-1.1.1.4"
+ extintf: "any"
+ mappedip:
+ -
+ range: "1.1.2.1-1.1.2.4" \ No newline at end of file
diff --git a/ansible_collections/fortinet/fortios/examples/set_system_alias.yml b/ansible_collections/fortinet/fortios/examples/set_system_alias.yml
new file mode 100644
index 00000000..542b0ec4
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_system_alias.yml
@@ -0,0 +1,23 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure alias command.
+ fortios_system_alias:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ state: "present"
+ system_alias:
+ name: "mytest"
+ command: "get system status"
diff --git a/ansible_collections/fortinet/fortios/examples/set_system_dns.yml b/ansible_collections/fortinet/fortios/examples/set_system_dns.yml
new file mode 100644
index 00000000..1a3d4eec
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_system_dns.yml
@@ -0,0 +1,21 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure admin users.
+ fortios_system_dns:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ system_dns:
+ primary: "2.32.2.2" \ No newline at end of file
diff --git a/ansible_collections/fortinet/fortios/examples/set_system_global.yml b/ansible_collections/fortinet/fortios/examples/set_system_global.yml
new file mode 100644
index 00000000..04869105
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_system_global.yml
@@ -0,0 +1,24 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure global attributes.
+ fortios_system_global:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ system_global:
+ admintimeout: "23"
+ hostname: "FortiGate11"
+ admin_lockout_threshold: "8"
+ admin_login_max: "9"
diff --git a/ansible_collections/fortinet/fortios/examples/set_system_ha.yml b/ansible_collections/fortinet/fortios/examples/set_system_ha.yml
new file mode 100644
index 00000000..cdfa9639
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_system_ha.yml
@@ -0,0 +1,24 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure HA.
+ fortios_system_ha:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ system_ha:
+ group_name: "testgroup"
+ mode: "standalone"
+ multicast_ttl: "38"
+ override: "enable" \ No newline at end of file
diff --git a/ansible_collections/fortinet/fortios/examples/set_system_ha_monitor.yml b/ansible_collections/fortinet/fortios/examples/set_system_ha_monitor.yml
new file mode 100644
index 00000000..634d5598
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_system_ha_monitor.yml
@@ -0,0 +1,21 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure HA monitor.
+ fortios_system_ha_monitor:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ system_ha_monitor:
+ monitor_vlan: "disable"
diff --git a/ansible_collections/fortinet/fortios/examples/set_system_ntp.yml b/ansible_collections/fortinet/fortios/examples/set_system_ntp.yml
new file mode 100644
index 00000000..009c5627
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_system_ntp.yml
@@ -0,0 +1,22 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure system NTP information.
+ fortios_system_ntp:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ system_ntp:
+ ntpsync: "disable"
+ server_mode: "disable" \ No newline at end of file
diff --git a/ansible_collections/fortinet/fortios/examples/set_system_zone.yml b/ansible_collections/fortinet/fortios/examples/set_system_zone.yml
new file mode 100644
index 00000000..1ac8a7c6
--- /dev/null
+++ b/ansible_collections/fortinet/fortios/examples/set_system_zone.yml
@@ -0,0 +1,27 @@
+---
+- hosts: localhost
+ collections:
+ - fortinet.fortios
+ vars:
+ host: "192.168.52.177"
+ username: "admin"
+ password: ""
+ vdom: "root"
+ ssl_verify: "False"
+ tasks:
+ - name: Configure zones to group two or more interfaces.
+ fortios_system_zone:
+ host: "{{ host }}"
+ username: "{{ username }}"
+ password: "{{ password }}"
+ vdom: "{{ vdom }}"
+ https: "True"
+ ssl_verify: "{{ ssl_verify }}"
+ state: "present"
+ system_zone:
+ intrazone: "allow"
+ name: "default_name_6"
+ tagging:
+ -
+ category: "default"
+ name: "default_name_9"