-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yml
54 lines (48 loc) · 1.46 KB
/
deploy.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
---
- name: Deploy traffic scripts
hosts: network
tasks:
- name: create /usr/local/iptables/
file:
path: /usr/local/iptables/
state: directory
- name: Copy openrc and venv
copy:
src: '{{ item }}'
dest: /usr/local/iptables/
loop:
- 'pkg/venv.tar'
- '/etc/openstack/admin-openrc.sh'
- '/etc/animbus/certificates/private/external/external.crt'
- name: Copy scripts and binary files
copy:
src: '{{ item }}'
dest: /usr/local/iptables/
mode: '0744'
loop:
- 'pkg/iptables'
- 'pkg/iptables-save'
- 'pkg/iptables-restore'
- 'scripts/iptables_manager.py'
- 'scripts/iptables_flow.py'
- 'pkg/logrotate.sh'
- name: Unarchive the tar file
unarchive:
src: /usr/local/iptables/venv.tar
dest: /usr/local/iptables/
remote_src: yes
creates: /usr/local/iptables/venv
- name: Execute logrotate setup script
command: /usr/local/iptables/logrotate.sh
- name: Create crontab to refresh iptables rules
cron:
name: "Run iptables_manager.py task every minute"
minute: "*"
job: "/usr/local/iptables/iptables_manager.py"
state: present
- name: Create crontab to refresh iptables rules
cron:
name: "Run iptables_flow.py task every minute"
minute: "*"
job: "/usr/local/iptables/iptables_flow.py"
state: present