Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
13c8b98
Removed dotdeb repos, upgraded to Jessie
n0p Dec 28, 2015
6962e87
Fixed npm, disabled (nearly) all by default
n0p Dec 28, 2015
7680c9d
added initial fail2ban support, added ipv4 hardening and ipv6 disabli…
n0p Feb 19, 2016
771fd4b
Added fail2ban additional jails, added modsecurity, added php-fpm, fi…
n0p Mar 3, 2016
8a5871c
Added cron-apt, added ncdu to base, corrected a few typos
n0p Mar 4, 2016
a500a15
fixed a bunch of typos, added some basic apache security configuration
n0p Mar 4, 2016
8551463
Fixed some problems with additional repositories, now we set a placeh…
n0p Mar 4, 2016
f077df4
isolated variables and created example file
n0p Mar 7, 2016
6c051db
now modphp also installs helper libraries
n0p Mar 7, 2016
e57652e
added bacula-fd
n0p Mar 7, 2016
402967c
Some fixes
n0p May 30, 2016
f438739
fixed "when" rules
n0p Sep 7, 2016
eada20d
added example hosts
n0p Sep 7, 2016
83702cd
Initialize mod_security2
n0p Sep 7, 2016
bc2b51d
Add php-apcu, do not disable native opcache
n0p Sep 7, 2016
f4963c6
switched from a2enmod to ansible module (@andrewc12)
n0p Sep 12, 2016
773631c
modified gitignore
n0p Sep 12, 2016
40bfe63
Base - Ensure aptitude is installed
n0p Sep 14, 2016
92b8005
Base - Add nano (RLY, OVH?)
n0p Sep 14, 2016
4e04ea4
typo + add apcu to php5
n0p Oct 14, 2016
5192c88
more derping :D
n0p Oct 14, 2016
0a26e57
fixed initial aptitude install
n0p Oct 19, 2016
b27c23d
fixed php for stretch release
n0p Oct 19, 2016
74128f3
fix nonfree repositories
n0p Oct 19, 2016
39f63bf
modified gitignore
n0p Dec 21, 2016
363b011
Add support to execute only the given role in a given host
VMRuiz Dec 23, 2016
aaa3fb4
Add code style into README
VMRuiz Dec 23, 2016
734a0a3
Merge pull request #1 from VMRuiz/master
n0p Dec 23, 2016
38e8642
added certbot (from mrjuliuss branch)
n0p Feb 28, 2017
4d61e4a
typos
n0p Feb 28, 2017
eef8ad7
added docker (from mrjuliuss branch)
n0p Feb 28, 2017
ebc1495
Update all.example
n0p Mar 24, 2017
59eb3d9
Added nodesource nodejs and npm
n0p Jul 17, 2017
fe5275c
Merge branch 'stretch' of github.com:n0p/debian-playbooks into stretch
n0p Jul 17, 2017
cc41b5c
Merge pull request #4 from n0p/stretch
n0p Jul 17, 2017
d11b446
Delete .directory
n0p Jul 17, 2017
6ce1681
Update .gitignore
n0p Jul 17, 2017
615d0bf
We don't need backports for certbot on stretch
n0p Jul 17, 2017
fc6625a
Fixed nonfree repository check
n0p Jul 17, 2017
0f41c1a
Updated README.md
n0p Jul 17, 2017
457f02b
Added missing classic net tools on stretch
n0p Jul 17, 2017
368c03a
Added mongo (from debian repo & mongodb.org repo) task
n0p Jul 17, 2017
707ce33
Enable MongoDB by default
n0p Jul 17, 2017
813987f
Added iptables-persistent (as in mrjuliuss' repository)
n0p Jul 17, 2017
62969c3
updated nginx default configuration
n0p Jul 17, 2017
4f92803
Added passenger role (app server for Ruby, Python and Node.js)
n0p Jul 17, 2017
4e88edb
Switched passenger to phusionpassenger's repositories (Jessie as stre…
n0p Jul 18, 2017
c9ff937
Detect and prepare apache2 for use with passenger
n0p Jul 18, 2017
bf17ccc
Detect and prepare apache2 for use with passenger
n0p Jul 18, 2017
26e9f0e
Fixed commit amend
n0p Jul 18, 2017
9f923df
passenger stretch release is now ready :D
n0p Jul 24, 2017
d24095c
fixed mariadb/mysql and jail.local
n0p Jun 13, 2018
1af2ff7
bumped node version, fixed mongodb
n0p Sep 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
hosts
playbook.retry
playbook-custom.yml
*.kate-swp
group_vars/all
custom*
.directory
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ Playbooks for debian server
- [fail2ban](roles/fail2ban)
- [zsh](roles/zsh)

(Check for more on the [roles](roles) directory)

### Launch ansible :

ansible-playbook playbook.yml -i hosts --user username --ask-pass --ask-sudo-pass
```
ansible-playbook playbook.yml -i hosts --user username --ask-pass --ask-sudo-pass
```

### Launch specific role in a host:

```
ansible-playbook run_role.yml -i 'hostname1,[hostname2, ...]' -e "ROLE={rolename}" --user {username} [--ask-pass] [--become] [--ask-become-pass]
```

Please note that at least one comma is required inside the -i arg. Example: `-i '192.168.1.10,'`
4 changes: 0 additions & 4 deletions group_vars/all

This file was deleted.

19 changes: 19 additions & 0 deletions group_vars/all.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
distribution_name: stretch

ntp_server_a: es.pool.ntp.org
ntp_server_b: pool.ntp.org

email_contact: root@locahost

nginx_processes: 4

safeips: 127.0.0.1

mysql_root_password: temporalMysqlRootPasswd

bacula_director_fqdn: bacula.server.domain
bacula_director_name: bacula-director.server
bacula_director_pass: achoquedices
bacula_monitor_name: bacula-monitor.server
bacula_monitor_pass: achoquedices

8 changes: 8 additions & 0 deletions hosts.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[host1]
127.0.0.1

[minimal]
127.0.1.1

[fullapache2]
127.0.1.2
45 changes: 37 additions & 8 deletions playbook.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
---
- hosts: all

- hosts: minimal
remote_user: root
sudo: true
roles:
- base
- cron-apt
- ntp
- git
- ipv4harden
- ipv6disable

- hosts: fullapache2
remote_user: root
sudo: true
roles:
- base
- cron-apt
- ntp
- git
- ipv4harden
- ipv6disable
- apache
- php-fpm
- apache-fastcgi
- mysql
- logwatch
- modsecurity
- fail2ban
- nginx
- php-fpm
- composer
- zsh
- node
- openvpn

- hosts: apache2simple
remote_user: root
sudo: true
roles:
- base
- cron-apt
- ntp
- git
- ipv4harden
- ipv6disable
- fail2ban
- php
- mysql
- apache

19 changes: 19 additions & 0 deletions roles/apache-fastcgi/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Checking for previously added repositories
stat: path=/etc/apt/sources.list.d/ftp_debian_org_debian.list
register: repos_present_nonfree

- name: Add contrib & non free repositories
apt_repository: repo='deb http://ftp.debian.org/debian/ {{ distribution_name }} contrib non-free' state=present
when: repos_present_nonfree.stat.exists == false

- name: Update apt cache
apt: update_cache=yes
when: repos_present_nonfree.stat.exists == false

- name: Install libapache2-mod-fastcgi
apt: pkg=libapache2-mod-fastcgi state=latest

- name: Enable fastcgi mod
action: command a2enmod fastcgi
notify: Restart apache2
13 changes: 9 additions & 4 deletions roles/apache/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
apt: pkg=apache2 state=latest

- name: Enable rewrite mod
action: command a2enmod rewrite
notify: Restart apache2
apache2_module: state=present name=rewrite

- name: Deploy restrictive security configuration
template: src=security-strict.conf.j2 dest=/etc/apache2/conf-available/security-strict.conf owner=root group=root mode=0640

- name: Copy apache2 config file
template: src=apache2.conf.j2 dest=/etc/apache2/apache2.conf
- name: Disable old security configuration
command: /usr/sbin/a2disconf security

- name: Enable new configuration
command: /usr/sbin/a2enconf security-strict
notify: Restart apache2
Loading