-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex-server.ansible.yml
81 lines (69 loc) · 1.8 KB
/
ex-server.ansible.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
---
- name: Setting Xinetd and iptables
hosts: all
gather_facts: false
tasks:
- name: Install Xinetd
ansible.builtin.apt:
name: xinetd
state: present
- name: Copy Setting Files
ansible.builtin.copy:
src: ./files/xinetd.conf
dest: /etc/xinetd.conf
owner: dsm
group: dsm
mode: '0644'
- name: Copy Script file
ansible.builtin.copy:
src: ./files/scripts
dest: /home/dsm/
owner: dsm
group: dsm
mode: '0774'
directory_mode: "1644"
- name: Copy Xinetd setting directory
ansible.builtin.copy:
src: ./files/xinetd.d
dest: /etc/
owner: dsm
group: dsm
mode: '1644'
- name: Install iptables
ansible.builtin.apt:
name: iptables
state: present
- name: Install iptables-persistent
ansible.builtin.apt:
name: iptables-persistent
state: present
- name: Copy iptables setting file
ansible.builtin.copy:
src: ./files/rules.v4
dest: /etc/iptables/rules.v4
owner: dsm
group: dsm
mode: '0644'
- name: Copy ip6tables setting file
ansible.builtin.copy:
src: ./files/rules.v6
dest: /etc/iptables/rules.v6
owner: dsm
group: dsm
mode: '0644'
- name: Add dummy service
lineinfile:
line: vnc 5900/tcp
path: /etc/services
- name: Start Xinetd
ansible.builtin.systemd_service:
name: xinetd
state: started
- name: Start packet filter
ansible.builtin.systemd_service:
name: netfilter-persistent
state: started
- name: Reload filtering rules
ansible.builtin.systemd_service:
name: netfilter-persistent
state: restarted