firewall rules for postgresql and redis

This commit is contained in:
Valentin CZERYBA 2022-10-06 22:29:53 +02:00
parent 73b5b7b867
commit 10f4f4863a
2 changed files with 43 additions and 1 deletions

View File

@ -46,4 +46,24 @@
- name: debug output
debug:
var: output
var: output
- name: Allow port postgresql
ansible.builtin.iptables:
chain: INPUT
protocol: tcp
destination_port: 54321
jump: ACCEPT
state: present
become: yes
become_method: sudo
- name: Allow port redis
ansible.builtin.iptables:
chain: INPUT
protocol: tcp
destination_port: 63791
jump: ACCEPT
state: present
become: yes
become_method: sudo

View File

@ -1,6 +1,27 @@
---
# tasks file for server
- name: Disallow port postgresql
ansible.builtin.iptables:
chain: INPUT
protocol: tcp
destination_port: 54321
jump: ACCEPT
state: absent
become: yes
become_method: sudo
- name: Disallow port redis
ansible.builtin.iptables:
chain: INPUT
protocol: tcp
destination_port: 63791
jump: ACCEPT
state: absent
become: yes
become_method: sudo
- name: Stopping existing service
community.docker.docker_compose:
project_src: /home/valentin/db
@ -11,3 +32,4 @@
- name: Debug output
debug:
var: output