-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible-playbook palo-create-tags-address-groups.yaml
51 lines (45 loc) · 1.3 KB
/
ansible-playbook palo-create-tags-address-groups.yaml
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
40
41
42
43
44
45
46
47
48
49
50
## DESCRIPTION
# Playbook that will connect to the firewall using credentials provided saved in either host.yaml or vars.yaml files and create an address group.
# Playbook will create tags and new address groups
## REQUIREMENTS
# pip install ansible
# ansible-galaxy install PaloAltoNetworks.paloaltonetworks
## EXECUTE
# ansible-playbook palo-create-tags-address-groups.yaml
---
- name: Creat an Address Group on the FW
hosts: PA-VM-02
connection: local
gather_facts: False
collections:
- paloaltonetworks.panos
tasks:
- name: Create tag object 'Prod'
panos_tag_object:
provider: '{{ provider }}'
name: 'Prod'
color: 'gold'
comments: 'Prod Environment'
- name: Create object group 'Production'
- name: Create tag object 'Servers'
panos_tag_object:
provider: '{{ provider }}'
name: 'Win-Server'
color: 'salmon'
comments: 'windows server'
- name: Create object group 'Production'
panos_address_group:
provider: '{{ provider }}'
name: 'Prod'
dynamic_value: "'Prod_Instances'"
tag: 'Prod'
state: 'present'
- name: Create object group 'Servers'
panos_address_group:
provider: '{{ provider }}'
name: 'Win-Servers'
dynamic_value: "'SI_Instances'"
tag: 'Win-Server'
state: 'present'
commit: True
...