playbook.yml aktualisiert
This commit is contained in:
parent
cbac698e31
commit
688ecab5cf
30
playbook.yml
30
playbook.yml
|
@ -1,34 +1,36 @@
|
||||||
---
|
---
|
||||||
|
- name: ensure safe environment for exams
|
||||||
|
hosts: localhost
|
||||||
|
|
||||||
# to verify ufw configuration run:
|
# to verify ufw configuration run:
|
||||||
# sudo ufw status verbose
|
# sudo ufw status verbose
|
||||||
|
tasks:
|
||||||
- name: Install ufw
|
- name: Install ufw
|
||||||
apt: package=ufw state=present
|
apt: package=ufw state=present
|
||||||
|
|
||||||
- name: Configure ufw defaults
|
- name: Configure ufw defaults
|
||||||
ufw: direction={{ item.direction }} policy={{ item.policy }}
|
ufw: direction={{ item.direction }} policy={{ item.policy }}
|
||||||
with_items:
|
with_items:
|
||||||
- { direction: 'incoming', policy: 'deny' }
|
- { direction: 'incoming', policy: 'deny' }
|
||||||
- { direction: 'outgoing', policy: 'deny' }
|
- { direction: 'outgoing', policy: 'deny' }
|
||||||
|
|
||||||
# disable ipv6
|
# disable ipv6
|
||||||
- lineinfile:
|
- lineinfile:
|
||||||
path: /etc/default/ufw
|
path: /etc/default/ufw
|
||||||
state: present
|
state: present
|
||||||
regexp: '^IPV6'
|
regexp: '^IPV6'
|
||||||
line: 'IPV6=no'
|
line: 'IPV6=no'
|
||||||
|
|
||||||
- name: Enable ufw logging
|
- name: Enable ufw logging
|
||||||
ufw: logging=off
|
ufw: logging=off
|
||||||
|
|
||||||
- name: Commenting a line.
|
- name: Commenting a line.
|
||||||
replace:
|
replace:
|
||||||
path: /etc/ufw/before.rules
|
path: /etc/ufw/before.rules
|
||||||
regexp: '(.*limit --limit*)'
|
regexp: '(.*limit --limit*)'
|
||||||
replace: '#\1'
|
replace: '#\1'
|
||||||
|
|
||||||
- name: Allow all access to tcp port 123
|
- name: Allow all access to tcp port 123
|
||||||
ufw:
|
ufw:
|
||||||
rule: allow
|
rule: allow
|
||||||
port: '123'
|
port: '123'
|
||||||
|
@ -37,7 +39,7 @@
|
||||||
- in
|
- in
|
||||||
- out
|
- out
|
||||||
|
|
||||||
- name: Allow SSH-Access to some servers
|
- name: Allow SSH-Access to some servers
|
||||||
ufw:
|
ufw:
|
||||||
rule: allow
|
rule: allow
|
||||||
direction: '{{ item.direction }}'
|
direction: '{{ item.direction }}'
|
||||||
|
@ -50,7 +52,7 @@
|
||||||
- { direction: 'out', destination: '10.16.1.1/32' }
|
- { direction: 'out', destination: '10.16.1.1/32' }
|
||||||
- { direction: 'in', destination: '162.55.5.40/32' }
|
- { direction: 'in', destination: '162.55.5.40/32' }
|
||||||
- { direction: 'out', destination: '162.55.5.40/32' }
|
- { direction: 'out', destination: '162.55.5.40/32' }
|
||||||
- name: Allow https-Access to some servers
|
- name: Allow https-Access to some servers
|
||||||
ufw:
|
ufw:
|
||||||
rule: allow
|
rule: allow
|
||||||
direction: '{{ item.direction }}'
|
direction: '{{ item.direction }}'
|
||||||
|
@ -64,21 +66,21 @@
|
||||||
- { direction: 'in', destination: '162.55.5.40/32' }
|
- { direction: 'in', destination: '162.55.5.40/32' }
|
||||||
- { direction: 'out', destination: '162.55.5.40/32' }
|
- { direction: 'out', destination: '162.55.5.40/32' }
|
||||||
|
|
||||||
- name: Enable ufw
|
- name: Enable ufw
|
||||||
ufw: state=enabled
|
ufw: state=enabled
|
||||||
|
|
||||||
- name: Allow dns
|
- name: Allow dns
|
||||||
ufw: rule={{ item.rule }} port={{ item.port }}
|
ufw: rule={{ item.rule }} port={{ item.port }}
|
||||||
with_items:
|
with_items:
|
||||||
- { rule: 'allow', port: '53'}
|
- { rule: 'allow', port: '53'}
|
||||||
|
|
||||||
|
|
||||||
- name: start ufw service
|
- name: start ufw service
|
||||||
service:
|
service:
|
||||||
name: ufw
|
name: ufw
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: purge some prior installed packages
|
- name: purge some prior installed packages
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
- task-kde-desktop
|
- task-kde-desktop
|
||||||
|
|
Loading…
Reference in New Issue