[firewall] Deploy firewall
parent
22ae971903
commit
eb84bca7a8
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env ansible-playbook
|
||||||
|
---
|
||||||
|
# Deploy firewall
|
||||||
|
- hosts: crans_routeurs
|
||||||
|
vars:
|
||||||
|
re2o:
|
||||||
|
server: re2o.adm.crans.org
|
||||||
|
service_user: "{{ vault_re2o_service_user }}"
|
||||||
|
service_password: "{{ vault_re2o_service_password }}"
|
||||||
|
roles:
|
||||||
|
- firewall
|
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
- name: Create firewall directory
|
||||||
|
file:
|
||||||
|
path: /var/local/firewall
|
||||||
|
state: directory
|
||||||
|
mode: '2775'
|
||||||
|
owner: root
|
||||||
|
group: nounou
|
||||||
|
|
||||||
|
- name: Set ACL for firewall directory
|
||||||
|
acl:
|
||||||
|
path: /var/local/firewall
|
||||||
|
default: true
|
||||||
|
entity: nounou
|
||||||
|
etype: group
|
||||||
|
permissions: rwx
|
||||||
|
state: query
|
||||||
|
|
||||||
|
- name: Clone firewall repository
|
||||||
|
git:
|
||||||
|
repo: 'http://gitlab.adm.crans.org/nounous/firewall.git'
|
||||||
|
dest: /var/local/firewall
|
||||||
|
umask: '002'
|
||||||
|
|
||||||
|
- name: Deploy re2o config
|
||||||
|
template:
|
||||||
|
src: firewall/re2o-config.ini.j2
|
||||||
|
dest: /var/local/firewall/re2o-config.ini
|
||||||
|
mode: 0600
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: Deploy cron for firewall
|
||||||
|
template:
|
||||||
|
src: cron.d/firewall.j2
|
||||||
|
dest: /etc/cron.d/firewall
|
|
@ -0,0 +1,2 @@
|
||||||
|
{{ ansible_header | comment }}
|
||||||
|
*/2 * * * * root /usr/bin/python3 /var/local/firewall/firewall.py -q
|
|
@ -0,0 +1,5 @@
|
||||||
|
{{ ansible_header | comment(decoration='; ') }}
|
||||||
|
[Re2o]
|
||||||
|
hostname = {{ re2o.server }}
|
||||||
|
username = {{ re2o.service_user }}
|
||||||
|
password = {{ re2o.service_password }}
|
Loading…
Reference in New Issue