noticket Changes from redeploy to new server
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
---
|
||||
deps: [
|
||||
cronie,
|
||||
docker,
|
||||
git,
|
||||
fail2ban,
|
||||
python-docker
|
||||
git,
|
||||
python-docker,
|
||||
tmux,
|
||||
weechat
|
||||
]
|
||||
|
||||
fail2ban_jails: [
|
||||
sshd.local,
|
||||
nginx.local
|
||||
]
|
||||
|
||||
services:
|
||||
- docker
|
||||
- fail2ban
|
||||
- iptables
|
||||
- nginx
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- import_tasks: deps.yml
|
||||
- import_tasks: security.yml
|
||||
- import_tasks: service.yml
|
||||
|
||||
9
ansible/roles/common/tasks/service.yml
Normal file
9
ansible/roles/common/tasks/service.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: ensure desired services are started and enabled
|
||||
become: true
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: started
|
||||
enabled: true
|
||||
loop: "{{ services }}"
|
||||
tags: security, service
|
||||
@@ -28,15 +28,6 @@
|
||||
recurse: true
|
||||
tags: http
|
||||
|
||||
- name: touch nginx logs, enable jail
|
||||
become: true
|
||||
file:
|
||||
path: "/var/log/nginx/error.log"
|
||||
state: file
|
||||
mode: 0644
|
||||
notify: restart_fail2ban
|
||||
tags: http, security
|
||||
|
||||
- name: template nginx http sites-available
|
||||
become: true
|
||||
template:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
- import_tasks: deps.yml
|
||||
- import_tasks: security.yml
|
||||
- import_tasks: modsec.yml
|
||||
- import_tasks: http.yml
|
||||
- import_tasks: https.yml
|
||||
|
||||
12
ansible/roles/http/tasks/security.yml
Normal file
12
ansible/roles/http/tasks/security.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: touch nginx logs, enable jail
|
||||
become: true
|
||||
file:
|
||||
path: "/var/log/nginx/{{ item }}.log"
|
||||
state: touch
|
||||
mode: 0644
|
||||
loop:
|
||||
- access
|
||||
- error
|
||||
notify: restart_fail2ban
|
||||
tags: http, security
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: generate openssl dhparam for nginx
|
||||
become: true
|
||||
command: |
|
||||
openssl dhparam -dsaparam -out /etc/ssl/certs/dhparam.pem 2048
|
||||
openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
|
||||
args:
|
||||
creates: /etc/ssl/certs/dhparam.pem
|
||||
tags: ssl
|
||||
|
||||
Reference in New Issue
Block a user