-
Notifications
You must be signed in to change notification settings - Fork 6
/
update_firewalls.yml
104 lines (89 loc) · 2.26 KB
/
update_firewalls.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
- name: Update firewalls
hosts: firewalls
user: root
vars_files:
- vars/aliases.yml
tasks:
- name: Create aliases directory
file: path=/usr/local/www/aliases state=directory
- name: Upload PHP script
copy: src=files/index.php dest=/usr/local/www/aliases/index.php
- name: List alias files
shell: ls -1 /usr/local/www/aliases/*.inc
ignore_errors: yes
register: contents
- name: Remove old files
file: name={{ item }} state=absent
with_items: contents.stdout_lines
- name: Upload aliases
lineinfile: dest=/usr/local/www/aliases/{{item.0.filename}}.inc line={{item.1}} create=yes
with_subelements:
- fw_aliases
- ips
- name: Reload url tables
command: /etc/rc.update_alias_url_data
- name: Reload url tables
command: /etc/rc.update_urltables
# - name: Set DNS
# xml:
# file: /cf/conf/config.xml
# xpath: /pfsense/system
# set_children:
# - dnsserver: "10.168.1.1"
- name: Set DNS servers
pfsense_generic:
option: dns
value:
- 10.168.1.1
tags:
- dns
- name: Set hostname
pfsense_generic:
option: hostname
value: firewall1
tags:
- dns
- name: Set domain
pfsense_generic:
option: domain
value: do.main
tags:
- dns
- name: Set timezone
pfsense_generic:
option: timezone
value: CET
tags:
- dns
- name: Set NTP servers
pfsense_generic:
option: ntptimeserver
value:
- 1.europe.pool.ntp.org
- 0.europe.pool.ntp.org
tags:
- dns
- name: Set IP2_alias
pfsense_aliases:
name: IP2_alias 8
description: Test alias 2
type: hosts
listofvalues:
18.18.18.2: "fw far1"
18.18.18.6: "fw far2"
18.18.18.3: "fw far3"
tags:
- alias
- name: Delete IP2_alias
pfsense_aliases:
name: IP2_alias 8
action: remove
description: Test alias 2
type: hosts
listofvalues:
18.18.18.2: "fw far1"
18.18.18.6: "fw far2"
18.18.18.3: "fw far3"
tags:
- alias