Browse Source

Merge branch 'master' into jessie

# Conflicts:
#	README.md
#	Vagrantfile
#	roles/mailserver/tasks/dovecot.yml
Alex Payne 9 years ago
parent
commit
3608ffa64a
57 changed files with 634 additions and 194 deletions
  1. 2
    1
      .travis.yml
  2. 7
    0
      AUTHORS.md
  3. 10
    0
      CONTRIBUTING.md
  4. 24
    0
      LICENSE.md
  5. 12
    38
      README.md
  6. 2
    2
      roles/blog/tasks/blog.yml
  7. 1
    8
      roles/blog/templates/etc_apache2_sites-available_blog.j2
  8. 2
    0
      roles/common/tasks/encfs.yml
  9. 5
    2
      roles/common/tasks/google_auth.yml
  10. 2
    0
      roles/common/tasks/google_auth_mod.yml
  11. 8
    4
      roles/common/tasks/main.yml
  12. 2
    0
      roles/common/tasks/ntp.yml
  13. 4
    1
      roles/common/tasks/security.yml
  14. 7
    0
      roles/common/tasks/ssl.yml
  15. 2
    0
      roles/common/tasks/ufw.yml
  16. 14
    0
      roles/common/templates/etc_apache2_ssl.conf.j2
  17. 7
    5
      roles/git/tasks/cgit.yml
  18. 2
    0
      roles/git/tasks/gitolite_packaged.yml
  19. 1
    9
      roles/git/templates/etc_apache2_sites-available_cgit.j2
  20. 5
    1
      roles/ircbouncer/tasks/znc.yml
  21. 10
    0
      roles/mailserver/files/etc_default_opendmarc
  22. 89
    0
      roles/mailserver/files/etc_opendmarc_import.sql
  23. 1
    1
      roles/mailserver/files/etc_postfix_master.cf
  24. 3
    0
      roles/mailserver/handlers/main.yml
  25. 3
    3
      roles/mailserver/tasks/autoconfig.yml
  26. 45
    0
      roles/mailserver/tasks/dmarc.yml
  27. 22
    10
      roles/mailserver/tasks/dovecot.yml
  28. 15
    1
      roles/mailserver/tasks/dspam.yml
  29. 2
    0
      roles/mailserver/tasks/main.yml
  30. 2
    0
      roles/mailserver/tasks/opendkim.yml
  31. 20
    15
      roles/mailserver/tasks/postfix.yml
  32. 13
    1
      roles/mailserver/tasks/solr.yml
  33. 9
    1
      roles/mailserver/tasks/z-push.yml
  34. 1
    8
      roles/mailserver/templates/etc_apache2_sites-available_autoconfig.j2
  35. 2
    2
      roles/mailserver/templates/etc_opendkim_TrustedHosts.j2
  36. 85
    0
      roles/mailserver/templates/etc_opendmarc.conf.j2
  37. 4
    0
      roles/mailserver/templates/etc_opendmarc_ignore.hosts.j2
  38. 20
    0
      roles/mailserver/templates/etc_opendmarc_report.sh.j2
  39. 5
    3
      roles/mailserver/templates/etc_postfix_main.cf.j2
  40. 26
    5
      roles/monitoring/tasks/collectd.yml
  41. 2
    0
      roles/monitoring/tasks/logwatch.yml
  42. 2
    0
      roles/monitoring/tasks/monit.yml
  43. 2
    0
      roles/newebe/tasks/newebe.yml
  44. 2
    9
      roles/newebe/templates/etc_apache2_sites-available_newebe.j2
  45. 18
    4
      roles/news/tasks/selfoss.yml
  46. 1
    8
      roles/news/templates/etc_apache2_sites-available_selfoss.j2
  47. 21
    1
      roles/owncloud/tasks/owncloud.yml
  48. 1
    8
      roles/owncloud/templates/etc_apache2_sites-available_owncloud.j2
  49. 24
    8
      roles/readlater/tasks/wallabag.yml
  50. 1
    8
      roles/readlater/templates/etc_apache2_sites-available_wallabag.j2
  51. 19
    13
      roles/tarsnap/tasks/tarsnap.yml
  52. 4
    0
      roles/vpn/tasks/openvpn.yml
  53. 14
    3
      roles/webmail/tasks/roundcube.yml
  54. 1
    8
      roles/webmail/templates/etc_apache2_sites-available_roundcube.j2
  55. 19
    0
      roles/xmpp/tasks/prosody.yml
  56. 5
    2
      vars/defaults.yml
  57. 2
    1
      vars/user.yml

+ 2
- 1
.travis.yml View File

@@ -1,6 +1,7 @@
1 1
 language: python
2 2
 python: "2.7"
3 3
 install:
4
-  - pip install ansible
4
+  - pip install ansible ansible-lint
5 5
 script:
6 6
   - ansible-playbook --syntax-check -i hosts site.yml
7
+  - ansible-lint site.yml

+ 7
- 0
AUTHORS.md View File

@@ -0,0 +1,7 @@
1
+# Authors
2
+
3
+Originated by [Alex Payne](https://al3x.net) ([@al3x](https://github.com/al3x)).
4
+
5
+Major contributions from [Luke Cyca](http://lukecyca.com/) ([@lukecyca](https://github.com/lukecyca)).
6
+
7
+Other talented and generous contributors to Sovereign can be viewed [on GitHub](https://github.com/sovereign/sovereign/graphs/contributors).

+ 10
- 0
CONTRIBUTING.md View File

@@ -0,0 +1,10 @@
1
+# Contributing to Sovereign
2
+
3
+_This document will be expanded upon._
4
+
5
+You'll want to set up a [local development environment](https://github.com/sovereign/sovereign/wiki/Development-Environment) so that you don’t have to test on a remote server.
6
+
7
+Make sure you agree with the license (GPLv3). See [LICENSE.md](./LICENSE.md) for details.
8
+
9
+If you issue a pull request, please specify what distribution you used for testing (if any).
10
+Code that is committed to the master branch should work with both Debian 7 and Ubuntu 14.04 LTS (Debian 8 support is coming up).

+ 24
- 0
LICENSE.md View File

@@ -0,0 +1,24 @@
1
+# License
2
+
3
+Original content is [GPLv3](http://gplv3.fsf.org/), the same license used by [Ansible](http://www.ansible.com/):
4
+
5
+```
6
+Sovereign: a set of Ansible playbooks to configure a personal cloud.
7
+
8
+Copyright (C) 2015 Alex Payne and contributors
9
+
10
+This program is free software: you can redistribute it and/or modify
11
+it under the terms of the GNU General Public License as published by
12
+the Free Software Foundation, either version 3 of the License, or
13
+(at your option) any later version.
14
+
15
+This program is distributed in the hope that it will be useful,
16
+but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+GNU General Public License for more details.
19
+
20
+You should have received a copy of the GNU General Public License
21
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+```
23
+
24
+All files and templates based on third-party software should be considered under their respective licenses.

+ 12
- 38
README.md View File

@@ -1,34 +1,20 @@
1
-[![Build Status](https://travis-ci.org/sovereign/sovereign.svg?branch=jessie)](https://travis-ci.org/sovereign/sovereign)
1
+[![Build Status](https://travis-ci.org/sovereign/sovereign.svg?branch=master)](https://travis-ci.org/sovereign/sovereign)
2 2
 
3 3
 Introduction
4 4
 ============
5 5
 
6
-Sovereign is a set of [Ansible](http://ansibleworks.com) playbooks that you can use to build and maintain your own [personal cloud](http://www.urbandictionary.com/define.php?term=clown%20computing) (I know I know). It’s based entirely on open source software, so you’re in control.
6
+Sovereign is a set of [Ansible](http://ansibleworks.com) playbooks that you can use to build and maintain your own [personal cloud](http://www.urbandictionary.com/define.php?term=clown%20computing) based entirely on open source software, so you’re in control.
7 7
 
8
-If you’ve never used Ansible before, you a) are in for a treat and b) might find these playbooks useful to learn from, since they show off a fair bit of what the tool can do.
8
+If you’ve never used Ansible before, you might find these playbooks useful to learn from, since they show off a fair bit of what the tool can do.
9 9
 
10
-Background and Motivations
11
---------------------------
10
+The original author's [background and motivations](https://github.com/sovereign/sovereign/wiki/Background-and-Motivations) might be of interest. tl;dr: frustrations with Google Apps and concerns about privacy and long-term support.
12 11
 
13
-I had been a paying Google Apps customer for personal and corporate use since the service was in beta. Until several weeks ago, that is. I was about to set up another Google Apps account for a new project when I stopped to consider what I would be funding with my USD \$50 per user per year:
14
-
15
-1.  [A seriously questionable privacy track record](https://en.wikipedia.org/wiki/Criticism_of_Google#Privacy).
16
-2.  [A dwindling commitment to open standards](https://www.eff.org/deeplinks/2013/05/google-abandons-open-standards-instant-messaging).
17
-3.  [A lack of long-term commitment to products](http://www.quora.com/Google-Products/What-are-all-the-Google-products-that-have-been-shut-down).
18
-4.  Development of Google+: a cynical and [unimaginative Facebook ripoff](http://gigaom.com/2012/03/15/google-plus-the-problem-isnt-design-its-a-lack-of-demand/) that’s [intruding into progressively more Google products](http://bits.blogs.nytimes.com/2012/03/06/google-defending-google-plus-shares-usage-numbers/?_r=0).
19
-
20
-To each her/his own, but personally I saw little reason to continue participating in the Google ecosystem. It had been years since I last ran my own server for email and such, but it’s only gotten cheaper and easier to do so. Plus, none of the commercial alternatives I looked at provided all the services I was looking for.
21
-
22
-Rather than writing up a long and hard-to-follow set of instructions, I decided to share my server setup in a format that you can more or less just clone, configure, and run. Ansible seemed like the most appropriate way to do that: it’s simple, straightforward, and easy to pick up.
23
-
24
-I’ve been using this setup for about a month now and it’s been great. It’s also replaced some non-Google services I used, saving me money and making me feel like I’ve got a little more privacy.
25
-
26
-A big chunk of the initial version was inspired by [this post by Drew Crawford](http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/). Unlike Drew, my goal is not “NSA-proofing” email, just providing a reasonable alternative to Google Apps that isn’t wildly insecure. If you need serious privacy and security (ex: for dissident activities), Sovereign might be useful as a starting point but will require additional work. Be careful out there.
12
+Sovereign offers useful cloud services while being reasonably secure and low-maintenance. Use it to set up your server, SSH in every couple weeks, but mostly forget about it.
27 13
 
28 14
 Services Provided
29 15
 -----------------
30 16
 
31
-What do you get if you point this thing at a VPS? All kinds of good stuff!
17
+What do you get if you point Sovereign at a server? All kinds of good stuff!
32 18
 
33 19
 -   [IMAP](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) over SSL via [Dovecot](http://dovecot.org/), complete with full text search provided by [Solr](https://lucene.apache.org/solr/).
34 20
 -   [POP3](https://en.wikipedia.org/wiki/Post_Office_Protocol) over SSL, also via Dovecot
@@ -59,8 +45,6 @@ What do you get if you point this thing at a VPS? All kinds of good stuff!
59 45
 -   Read-it-later via [Wallabag](https://www.wallabag.org/)
60 46
 -   A bunch of nice-to-have tools like [mosh](http://mosh.mit.edu) and [htop](http://htop.sourceforge.net) that make life with a server a little easier.
61 47
 
62
-No setup is perfect, but the general idea is to provide a bunch of useful services while being reasonably secure and low-maintenance. Set it up, SSH in every couple weeks, but mostly forget about it.
63
-
64 48
 Don’t want one or more of the above services? Comment out the relevant role in `site.yml`. Or get more granular and comment out the associated `include:` directive in one of the playbooks.
65 49
 
66 50
 Usage
@@ -81,7 +65,7 @@ Installation
81 65
 
82 66
 Generate a private key and a certificate signing request (CSR):
83 67
 
84
-    openssl req -nodes -newkey rsa:2048 -keyout roles/common/files/wildcard_private.key -out mycert.csr
68
+    openssl req -nodes -newkey rsa:2048 -keyout roles/common/files/wildcard_private.key -sha256 -out mycert.csr
85 69
 
86 70
 Purchase a wildcard cert from a certificate authority, such as [Positive SSL](https://positivessl.com) or [AlphaSSL](https://www.alphassl.com). You will provide them with the contents of your CSR, and in return they will give you your signed public certificate. Place the certificate in `roles/common/files/wildcard_public_cert.crt`.
87 71
 
@@ -97,7 +81,7 @@ Purchasing SSL certs, and wildcard certs specifically, can be a significant fina
97 81
 
98 82
 To create a self-signed SSL cert, run the following commands:
99 83
 
100
-    openssl req -nodes -newkey rsa:2048 -keyout roles/common/files/wildcard_private.key -out mycert.csr
84
+    openssl req -nodes -newkey rsa:2048 -keyout roles/common/files/wildcard_private.key -sha256 -out mycert.csr
101 85
     openssl x509 -req -days 365 -in mycert.csr -signkey roles/common/files/wildcard_private.key -out roles/common/files/wildcard_public_cert.crt
102 86
     cp roles/common/files/wildcard_public_cert.crt roles/common/files/wildcard_ca.pem
103 87
 
@@ -198,6 +182,8 @@ To run just one or more piece, use tags. I try to tag all my includes for easy i
198 182
 
199 183
 You might find that it fails at one point or another. This is probably because something needs to be done manually, usually because there’s no good way of automating it. Fortunately, all the tasks are clearly named so you should be able to find out where it stopped. I’ve tried to add comments where manual intervention is necessary.
200 184
 
185
+The `dependencies` tag just installs dependencies, performing no other operations. The tasks associated with the `dependencies` tag do not rely on the user-provided settings that live in `vars/user.yml`. Running the playbook with the `dependencies` tag is particularly convenient for working with Docker images.
186
+
201 187
 ### 6. Set up DNS
202 188
 
203 189
 If you’ve just bought a new domain name, point it at [Linode’s DNS Manager](https://library.linode.com/dns-manager) or similar. Most VPS services (and even some domain registrars) offer a managed DNS service that you can use for this at no charge. If you’re using an existing domain that’s already managed elsewhere, you can probably just modify a few records.
@@ -233,12 +219,12 @@ Finally, sign into ownCloud to set it up. You should select PostgreSQL as the co
233 219
 How To Use Your New Personal Cloud
234 220
 ----------------------------------
235 221
 
236
-We’re collecting known-good client setups [on our wiki](https://github.com/al3x/sovereign/wiki/Usage).
222
+We’re collecting known-good client setups [on our wiki](https://github.com/sovereign/sovereign/wiki/Usage).
237 223
 
238 224
 Troubleshooting
239 225
 ---------------
240 226
 
241
-If you run into an errors, please check the [wiki page](https://github.com/al3x/sovereign/wiki/Troubleshooting). If the problem you encountered, is not listed, please go ahead and [create an issue](https://github.com/al3x/sovereign/issues/new). If you already have a bugfix and/or workaround, just put them in the issue and the wiki page.
227
+If you run into an errors, please check the [wiki page](https://github.com/sovereign/sovereign/wiki/Troubleshooting). If the problem you encountered, is not listed, please go ahead and [create an issue](https://github.com/sovereign/sovereign/issues/new). If you already have a bugfix and/or workaround, just put them in the issue and the wiki page.
242 228
 
243 229
 ### Reboots
244 230
 
@@ -252,15 +238,3 @@ IRC
252 238
 ===
253 239
 
254 240
 Ask questions and provide feedback in `#sovereign` on [Freenode](http://freenode.net).
255
-
256
-Contributing
257
-============
258
-
259
-You may want to set up a [local development environment](https://github.com/al3x/sovereign/wiki/Development-Environment) so that you don’t have to test on your real server.
260
-
261
-If you improve one of the provided playbooks or add an exciting new one, send a pull request. Everyone benefits.
262
-
263
-License
264
--------
265
-
266
-Original content is [GPLv3](http://gplv3.fsf.org), same as Ansible. All files and templates based on third-party software should be considered under their respective licenses.

+ 2
- 2
roles/blog/tasks/blog.yml View File

@@ -1,11 +1,11 @@
1 1
 - name: Create directory for blog HTML
2
-  file: state=directory path=/var/www/{{ domain }} group=www-data owner=www-data
2
+  file: state=directory path=/var/www/{{ domain }} group=www-data owner={{ main_user_name }}
3 3
 
4 4
 - name: Rename existing Apache blog virtualhost
5 5
   command: mv /etc/apache2/sites-available/{{ domain }} /etc/apache2/sites-available/{{ domain }}.conf removes=/etc/apache2/sites-available/{{ domain }}
6 6
 
7 7
 - name: Remove old sites-enabled/{{ domain }} symlink (new one will be created by a2ensite)
8
-  command: rm /etc/apache2/sites-enabled/{{ domain }} removes=/etc/apache2/sites-enabled/{{ domain }}
8
+  file: path=/etc/apache2/sites-enabled/{{ domain }} state=absent
9 9
 
10 10
 - name: Configure the Apache HTTP server for the blog
11 11
   template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/{{ domain }}.conf group=root owner=root

+ 1
- 8
roles/blog/templates/etc_apache2_sites-available_blog.j2 View File

@@ -10,14 +10,7 @@
10 10
     ServerName {{ domain }}
11 11
     ServerAlias www.{{ domain }}
12 12
 
13
-    SSLEngine on
14
-    SSLProtocol ALL -SSLv2 -SSLv3
15
-    SSLHonorCipherOrder On
16
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
17
-    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
18
-    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
19
-    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
20
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
13
+    Include /etc/apache2/ssl.conf
21 14
 
22 15
     DocumentRoot            "/var/www/{{ domain }}"
23 16
     DirectoryIndex          index.html

+ 2
- 0
roles/common/tasks/encfs.yml View File

@@ -4,6 +4,8 @@
4 4
     - encfs
5 5
     - fuse
6 6
     - libfuse-dev
7
+  tags:
8
+    - dependencies
7 9
 
8 10
 - name: Create encrypted directory
9 11
   file: state=directory path=/encrypted

+ 5
- 2
roles/common/tasks/google_auth.yml View File

@@ -7,14 +7,17 @@
7 7
     #- libpam-google-authenticator    wasn't available in wheezy
8 8
     - libpam0g-dev
9 9
     - libqrencode3
10
+  tags:
11
+    - dependencies
10 12
 
11 13
 - name: Download Google authenticator pam module
12 14
   get_url: url=https://google-authenticator.googlecode.com/files/libpam-google-authenticator-{{ google_auth_version }}-source.tar.bz2
13 15
            dest=/root/libpam-google-authenticator-{{ google_auth_version }}-source.tar.bz2
14 16
 
15 17
 - name: Extract Google authenticator
16
-  command: tar xjf libpam-google-authenticator-{{ google_auth_version }}-source.tar.bz2
17
-           chdir=/root creates=/root/libpam-google-authenticator-{{ google_auth_version }}
18
+  unarchive: src=/root/libpam-google-authenticator-{{ google_auth_version }}-source.tar.bz2
19
+             creates=/root/libpam-google-authenticator-{{ google_auth_version }}
20
+             dest=/root copy=no
18 21
 
19 22
 - name: Install Google authenticator
20 23
   command: make install

+ 2
- 0
roles/common/tasks/google_auth_mod.yml View File

@@ -8,6 +8,8 @@
8 8
     - libpam-google-authenticator
9 9
     - libpam0g-dev
10 10
     - libqrencode3
11
+  tags:
12
+    - dependencies
11 13
 
12 14
 - name: Update sshd config to enable challenge responses
13 15
   lineinfile: dest=/etc/ssh/sshd_config

+ 8
- 4
roles/common/tasks/main.yml View File

@@ -3,12 +3,18 @@
3 3
 - name: Set up closest mirror autoselect (ubuntu-only)
4 4
   template: src=apt_sources.list.j2 dest=/etc/apt/sources.list
5 5
   when: ansible_distribution == 'Ubuntu'
6
+  tags:
7
+    - dependencies
6 8
 
7 9
 - name: Update apt cache
8 10
   apt: update_cache=yes
11
+  tags:
12
+    - dependencies
9 13
 
10 14
 - name: Upgrade all safe packages
11 15
   apt: upgrade=safe
16
+  tags:
17
+    - dependencies
12 18
 
13 19
 - name: Install necessities and nice-to-haves
14 20
   apt: pkg={{ item }} state=installed
@@ -32,6 +38,8 @@
32 38
     - molly-guard
33 39
     - vim
34 40
     - zsh
41
+  tags:
42
+    - dependencies
35 43
 
36 44
 - name: Set timezone to UTC
37 45
   action: shell echo Etc/UTC > /etc/timezone
@@ -43,10 +51,6 @@
43 51
   action: command dpkg-reconfigure -f noninteractive tzdata
44 52
   when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
45 53
 
46
-- name: Install unattended upgrades (Debian/Ubuntu only)
47
-  apt: pkg=unattended-upgrades state=installed
48
-  when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
49
-
50 54
 - name: Apticron email configuration
51 55
   template: src=apticron.conf.j2 dest=/etc/apticron/apticron.conf
52 56
 

+ 2
- 0
roles/common/tasks/ntp.yml View File

@@ -3,6 +3,8 @@
3 3
 
4 4
 - name: Install ntp
5 5
   apt: pkg=ntp state=installed
6
+  tags:
7
+    - dependencies
6 8
 
7 9
 - name: Configure ntp
8 10
   template: src=ntp.conf.j2 dest=/etc/ntp.conf

+ 4
- 1
roles/common/tasks/security.yml View File

@@ -2,8 +2,11 @@
2 2
   apt: pkg={{ item }} state=installed
3 3
   with_items:
4 4
     - fail2ban
5
+    - whois
5 6
     - lynis
6 7
     - rkhunter
8
+  tags:
9
+    - dependencies
7 10
 
8 11
 - name: Copy fail2ban configuration into place
9 12
   template: src=etc_fail2ban_jail.local.j2 dest=/etc/fail2ban/jail.local
@@ -19,7 +22,7 @@
19 22
 - name: Update sshd config for PFS and more secure defaults
20 23
   template: src=etc_ssh_sshd_config.j2 dest=/etc/ssh/sshd_config
21 24
   notify: restart ssh
22
-  
25
+
23 26
 - name: Update ssh config for more secure defaults
24 27
   template: src=etc_ssh_ssh_config.j2 dest=/etc/ssh/ssh_config
25 28
 

+ 7
- 0
roles/common/tasks/ssl.yml View File

@@ -19,3 +19,10 @@
19 19
 
20 20
 - name: Enable NameVirtualHost for HTTPS
21 21
   lineinfile: dest=/etc/apache2/ports.conf regexp='^    NameVirtualHost \*:443' insertafter='^<IfModule mod_ssl.c>' line='    NameVirtualHost *:443'
22
+
23
+- name: Add common Apache SSL config
24
+  template:
25
+    src=etc_apache2_ssl.conf.j2
26
+    dest=/etc/apache2/ssl.conf
27
+    owner=root
28
+    group=root

+ 2
- 0
roles/common/tasks/ufw.yml View File

@@ -4,6 +4,8 @@
4 4
 # ufw includes sensible icmp defaults
5 5
 - name: Install ufw
6 6
   apt: pkg=ufw state=present
7
+  tags:
8
+    - dependencies
7 9
 
8 10
 - name: Deny everything
9 11
   ufw: policy=deny

+ 14
- 0
roles/common/templates/etc_apache2_ssl.conf.j2 View File

@@ -0,0 +1,14 @@
1
+SSLEngine on
2
+SSLProtocol ALL -SSLv2 -SSLv3
3
+SSLHonorCipherOrder On
4
+SSLCompression off
5
+{% if ansible_distribution_release != 'wheezy' %}
6
+    SSLUseStapling On
7
+    SSLStaplingResponderTimeout 5
8
+    SSLStaplingReturnResponderErrors off
9
+{% endif %}
10
+SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
11
+SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
12
+SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
13
+SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
14
+Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"

+ 7
- 5
roles/git/tasks/cgit.yml View File

@@ -5,6 +5,8 @@
5 5
     - groff
6 6
     - libssl-dev
7 7
     - python-pip
8
+  tags:
9
+    - dependencies
8 10
 
9 11
 - name: Install cgit pip dependencies
10 12
   pip: name={{ item }}
@@ -17,9 +19,9 @@
17 19
            dest=/root/cgit-{{ cgit_version }}.tar.xz
18 20
 
19 21
 - name: Decompress cgit source
20
-  command: tar xvfJ /root/cgit-{{ cgit_version }}.tar.xz
21
-           chdir=/root
22
-           creates=/root/cgit-{{ cgit_version }}/configure
22
+  unarchive: src=/root/cgit-{{ cgit_version }}.tar.xz
23
+             dest=/root copy=no
24
+             creates=/root/cgit-{{ cgit_version }}/configure
23 25
 
24 26
 - name: Build and install cgit
25 27
   shell: make get-git ; make ; make install
@@ -30,13 +32,13 @@
30 32
 - name: Copy cgitrc
31 33
   template: src=etc_cgitrc.j2 dest=/etc/cgitrc
32 34
             group=www-data
33
-            owner=www-data
35
+            owner=root
34 36
 
35 37
 - name: Rename existing Apache cgit virtualhost
36 38
   command: mv /etc/apache2/sites-available/cgit /etc/apache2/sites-available/cgit.conf removes=/etc/apache2/sites-available/cgit
37 39
 
38 40
 - name: Remove old sites-enabled/cgit symlink (new one will be created by a2ensite)
39
-  command: rm /etc/apache2/sites-enabled/cgit removes=/etc/apache2/sites-enabled/cgit
41
+  file: path=/etc/apache2/sites-enabled/cgit state=absent
40 42
 
41 43
 - name: Configure the Apache HTTP server for cgit
42 44
   template: src=etc_apache2_sites-available_cgit.j2

+ 2
- 0
roles/git/tasks/gitolite_packaged.yml View File

@@ -9,6 +9,8 @@
9 9
 
10 10
 - name: Install gitolite3 package
11 11
   apt: pkg=gitolite3 state=installed
12
+  tags:
13
+    - dependencies
12 14
 
13 15
 - name: Copy .gitolite.rc file
14 16
   copy: src=home_git_.gitolite.rc

+ 1
- 9
roles/git/templates/etc_apache2_sites-available_cgit.j2 View File

@@ -7,15 +7,7 @@
7 7
 <VirtualHost *:443>
8 8
     ServerName {{ cgit_domain }}
9 9
 
10
-    SSLEngine on
11
-    SSLProtocol ALL -SSLv2 -SSLv3
12
-    SSLHonorCipherOrder On
13
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
14
-    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
15
-    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
16
-    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
17
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
18
-
10
+    Include /etc/apache2/ssl.conf
19 11
     DocumentRoot /var/www/htdocs/cgit/
20 12
 
21 13
     <Directory "/var/www/htdocs/cgit/">

+ 5
- 1
roles/ircbouncer/tasks/znc.yml View File

@@ -15,12 +15,16 @@
15 15
     - pkg-config
16 16
     - python3-dev
17 17
     - swig
18
+  tags:
19
+    - dependencies
18 20
 
19 21
 - name: Download znc release
20 22
   get_url: url=http://znc.in/releases/archive/znc-{{ znc_version }}.tar.gz dest=/root/znc-{{ znc_version }}.tar.gz
21 23
 
22 24
 - name: Decompress znc source
23
-  command: tar xzf /root/znc-{{ znc_version }}.tar.gz chdir=/root creates=/root/znc-{{ znc_version }}/configure
25
+  unarchive: src=/root/znc-{{ znc_version }}.tar.gz
26
+             dest=/root copy=no
27
+             creates=/root/znc-{{ znc_version }}/configure
24 28
 
25 29
 - name: Build and install znc
26 30
   shell: ./configure --enable-python && make && make install executable=/bin/bash chdir=/root/znc-{{ znc_version }} creates=/usr/local/bin/znc

+ 10
- 0
roles/mailserver/files/etc_default_opendmarc View File

@@ -0,0 +1,10 @@
1
+# Command-line options specified here will override the contents of
2
+# /etc/opendmarc.conf. See opendmarc(8) for a complete list of options.
3
+#DAEMON_OPTS=""
4
+#
5
+# Uncomment to specify an alternate socket
6
+# Note that setting this will override any Socket value in opendkim.conf
7
+SOCKET="inet:54321" # listen on all interfaces on port 54321
8
+#SOCKET="local:/var/run/opendmarc/opendmarc.sock" # default
9
+#SOCKET="inet:12345@localhost" # listen on loopback on port 12345
10
+#SOCKET="inet:12345@192.0.2.1" # listen on 192.0.2.1 on port 12345

+ 89
- 0
roles/mailserver/files/etc_opendmarc_import.sql View File

@@ -0,0 +1,89 @@
1
+-- OpenDMARC database schema
2
+--
3
+-- Copyright (c) 2012, The Trusted Domain Project.
4
+--      All rights reserved.
5
+
6
+USE opendmarc;
7
+
8
+-- A table for mapping domain names and their DMARC policies to IDs
9
+CREATE TABLE IF NOT EXISTS domains (
10
+        id INT NOT NULL AUTO_INCREMENT,
11
+        name VARCHAR(255) NOT NULL,
12
+        firstseen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
+
14
+        PRIMARY KEY(id),
15
+        UNIQUE KEY(name)
16
+);
17
+
18
+-- A table for logging reporting requests
19
+CREATE TABLE IF NOT EXISTS requests (
20
+        id INT NOT NULL AUTO_INCREMENT,
21
+        domain INT NOT NULL,
22
+        repuri VARCHAR(255) NOT NULL,
23
+        adkim TINYINT NOT NULL,
24
+        aspf TINYINT NOT NULL,
25
+        policy TINYINT NOT NULL,
26
+        spolicy TINYINT NOT NULL,
27
+        pct TINYINT NOT NULL,
28
+        locked TINYINT NOT NULL,
29
+        firstseen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
30
+        lastsent TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
31
+
32
+        PRIMARY KEY(id),
33
+        KEY(lastsent),
34
+        UNIQUE KEY(domain)
35
+);
36
+
37
+-- A table for reporting hosts
38
+CREATE TABLE IF NOT EXISTS reporters (
39
+        id INT NOT NULL AUTO_INCREMENT,
40
+        name VARCHAR(255) NOT NULL,
41
+        firstseen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
42
+
43
+        PRIMARY KEY(id),
44
+        UNIQUE KEY(name)
45
+);
46
+
47
+-- A table for IP addresses
48
+CREATE TABLE IF NOT EXISTS ipaddr (
49
+	id INT NOT NULL AUTO_INCREMENT,
50
+	addr VARCHAR(64) NOT NULL,
51
+	firstseen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
52
+
53
+	PRIMARY KEY(id),
54
+	UNIQUE KEY(addr)
55
+);
56
+
57
+-- A table for messages
58
+CREATE TABLE IF NOT EXISTS messages (
59
+        id INT NOT NULL AUTO_INCREMENT,
60
+        date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
61
+        jobid VARCHAR(128) NOT NULL,
62
+        reporter INT UNSIGNED NOT NULL,
63
+        policy TINYINT UNSIGNED NOT NULL,
64
+        disp TINYINT UNSIGNED NOT NULL,
65
+        ip INT UNSIGNED NOT NULL,
66
+        env_domain INT UNSIGNED NOT NULL,
67
+        from_domain INT UNSIGNED NOT NULL,
68
+        policy_domain INT UNSIGNED NOT NULL,
69
+        spf TINYINT UNSIGNED NOT NULL,
70
+        align_dkim TINYINT UNSIGNED NOT NULL,
71
+        align_spf TINYINT UNSIGNED NOT NULL,
72
+        sigcount TINYINT UNSIGNED NOT NULL,
73
+
74
+        PRIMARY KEY(id),
75
+        KEY(date),
76
+        UNIQUE KEY(reporter, date, jobid)
77
+);
78
+
79
+-- A table for signatures
80
+CREATE TABLE IF NOT EXISTS signatures (
81
+        id INT NOT NULL AUTO_INCREMENT,
82
+        message INT NOT NULL,
83
+        domain INT NOT NULL,
84
+        pass TINYINT NOT NULL,
85
+        error TINYINT NOT NULL,
86
+
87
+        PRIMARY KEY(id),
88
+        KEY(message)
89
+);

+ 1
- 1
roles/mailserver/files/etc_postfix_master.cf View File

@@ -117,4 +117,4 @@ mailman   unix  -       n       n       -       -       pipe
117 117
 dspam     unix  -       n       n       -       10      pipe
118 118
   flags=Ru user=dspam argv=/usr/bin/dspam --deliver=innocent,spam --user ${user}@${domain} -i -f $sender -- $recipient
119 119
 dovecot   unix  -       n       n       -       -       pipe
120
-  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d ${user}@${nexthop}
120
+  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/lmtp -f ${sender} -d ${user}@${nexthop}

+ 3
- 0
roles/mailserver/handlers/main.yml View File

@@ -13,3 +13,6 @@
13 13
 - name: import sql postfix
14 14
   action: shell PGPASSWORD='{{ mail_db_password }}' psql -h localhost -d {{ mail_db_database }} -U {{ mail_db_username }} -f /etc/postfix/import.sql --set ON_ERROR_STOP=1
15 15
   notify: restart postfix
16
+
17
+- name: restart opendmarc
18
+  service: name=opendmarc state=restarted

+ 3
- 3
roles/mailserver/tasks/autoconfig.yml View File

@@ -5,13 +5,13 @@
5 5
 #
6 6
 
7 7
 - name: Create directory for mail autoconfiguration virtualhost
8
-  file: state=directory path=/var/www/autoconfig group=www-data owner=www-data
8
+  file: state=directory path=/var/www/autoconfig group=www-data owner=root
9 9
 
10 10
 - name: Create directory holding the autoconfig XML file
11
-  file: state=directory path=/var/www/autoconfig/mail group=www-data owner=www-data
11
+  file: state=directory path=/var/www/autoconfig/mail group=www-data owner=root
12 12
 
13 13
 - name: Create the autoconfig XML file
14
-  template: src=var_www_autoconfig_mail_config-v1.1.j2 dest=/var/www/autoconfig/mail/config-v1.1.xml group=www-data owner=www-data
14
+  template: src=var_www_autoconfig_mail_config-v1.1.j2 dest=/var/www/autoconfig/mail/config-v1.1.xml group=www-data owner=root
15 15
 
16 16
 - name: Configure the mail autoconfiguration virtualhost
17 17
   template: src=etc_apache2_sites-available_autoconfig.j2 dest=/etc/apache2/sites-available/autoconfig.conf group=root owner=root

+ 45
- 0
roles/mailserver/tasks/dmarc.yml View File

@@ -0,0 +1,45 @@
1
+- name: Install OpenDMARC milter and related packages
2
+  apt: pkg={{ item }} state=installed update_cache=yes
3
+  with_items:
4
+      - mysql-server
5
+      - python-mysqldb
6
+      - opendmarc
7
+
8
+- name: Copy OpenDMARC configuration file into place
9
+  template: src=etc_opendmarc.conf.j2 dest=/etc/opendmarc.conf owner=root group=root
10
+  notify: restart opendmarc
11
+
12
+- name: Create OpenDMARC configuration directory
13
+  file: state=directory path=/etc/opendmarc
14
+
15
+- name: Copy OpenDMARC ignore hosts file into place
16
+  template: src=etc_opendmarc_ignore.hosts.j2 dest=/etc/opendmarc/ignore.hosts owner=root group=root
17
+
18
+- name: Copy OpenDMARC defaults file into place
19
+  copy: src=etc_default_opendmarc dest=/etc/default/opendmarc owner=root group=root
20
+  notify:
21
+    - restart opendmarc
22
+    - restart postfix
23
+
24
+- name: Copy OpenDMARC database schema file into place
25
+  copy: src=etc_opendmarc_import.sql dest=/etc/opendmarc/import.sql owner=root group=root
26
+
27
+- name: Create database user for OpenDMARC reports
28
+  mysql_user: user={{ mail_db_opendmarc_username }} password={{ mail_db_opendmarc_password }} state=present priv="opendmarc.*:ALL"
29
+
30
+- name: Create database for OpenDMARC reports
31
+  mysql_db: name={{ mail_db_opendmarc_database }} state=present
32
+
33
+- name: Import database schema for OpenDMARC reports
34
+  mysql_db: name={{ mail_db_opendmarc_database }} state=import target=/etc/opendmarc/import.sql
35
+  tags: import_mysql_postfix
36
+
37
+- name: Copy nightly OpenDMARC report generation script into place
38
+  template: src=etc_opendmarc_report.sh.j2 dest=/etc/opendmarc/report.sh owner=root group=root mode="755"
39
+
40
+- name: Touch initial report dat file with correct permissions
41
+  file: path=/var/run/opendmarc/opendmarc.dat state=touch owner=opendmarc group=opendmarc
42
+
43
+- name: Activate OpenDMARC report cronjob
44
+  cron: name="OpenDMARC report" hour="2" minute="0" job="/bin/bash /etc/opendmarc/report.sh >> /var/log/opendmarc_report.log"
45
+

+ 22
- 10
roles/mailserver/tasks/dovecot.yml View File

@@ -1,9 +1,11 @@
1 1
 - name: Add wheezy-backports to get a reasonably current Dovecot on Debian 7
2 2
   apt_repository: repo='deb http://http.debian.net/debian wheezy-backports main'
3 3
   when: ansible_distribution_release == 'wheezy'
4
+  tags:
5
+    - dependencies
4 6
 
5 7
 - name: Install Dovecot and related packages on Debian 7
6
-  apt: pkg={{ item }} update_cache=yes state=installed default_release=wheezy-backports
8
+  apt: pkg={{ item }} update_cache=yes state=latest default_release=wheezy-backports
7 9
   with_items:
8 10
     - dovecot-core
9 11
     - dovecot-imapd
@@ -12,6 +14,8 @@
12 14
     - dovecot-pgsql
13 15
     - dovecot-pop3d
14 16
   when: ansible_distribution_release == 'wheezy'
17
+  tags:
18
+    - dependencies
15 19
 
16 20
 - name: Install Dovecot and related packages on distributions other than Debian 7
17 21
   apt: pkg={{ item }} update_cache=yes state=installed
@@ -23,18 +27,26 @@
23 27
     - dovecot-pgsql
24 28
     - dovecot-pop3d
25 29
   when: ansible_distribution_release != 'wheezy'
30
+  tags:
31
+    - dependencies
26 32
 
27
-- name: Install Dovecot Postgres dependency for distributions other than Ubuntu Trusty
28
-  apt: pkg={{ item }} state=installed
29
-  with_items:
30
-    - postgresql-9.1
31
-  when: ansible_distribution_release != 'trusty'
33
+- name: Install Postgres 9.1 for Dovecot on older distributions
34
+  apt: pkg=postgresql-9.1 state=present
35
+  when: ansible_distribution_release != 'trusty' and ansible_distribution_release != 'jessie'
36
+  tags:
37
+    - dependencies
32 38
 
33
-- name: Install Dovecot Postgres dependency for Ubuntu trusty
34
-  apt: pkg={{ item }} state=installed
35
-  with_items:
36
-    - postgresql-9.3
39
+- name: Install Postgres 9.3 for Dovecot on Ubuntu Trusty
40
+  apt: pkg=postgresql-9.3 state=present
37 41
   when: ansible_distribution_release == 'trusty'
42
+  tags:
43
+    - dependencies
44
+
45
+- name: Install Postgres 9.4 for Dovecot on Debian Jessie
46
+  apt: pkg=postgresql-9.4 state=present
47
+  when: ansible_distribution_release == 'jessie'
48
+  tags:
49
+    - dependencies
38 50
 
39 51
 - name: Create vmail group
40 52
   group: name=vmail state=present gid=5000

+ 15
- 1
roles/mailserver/tasks/dspam.yml View File

@@ -1,10 +1,24 @@
1
-- name: Install dspam and related packages
1
+- name: Install dspam and related packages on wheezy
2
+  apt: pkg={{ item }} state=installed default_release=wheezy-backports
3
+  with_items:
4
+    - dovecot-antispam
5
+    - dovecot-sieve
6
+    - dspam
7
+    - postfix-pcre
8
+  when: ansible_distribution_release == 'wheezy'
9
+  tags:
10
+    - dependencies
11
+
12
+- name: Install dspam and related packages on distributions other than wheezy
2 13
   apt: pkg={{ item }} state=installed
3 14
   with_items:
4 15
     - dovecot-antispam
5 16
     - dovecot-sieve
6 17
     - dspam
7 18
     - postfix-pcre
19
+  when: ansible_distribution_release != 'wheezy'
20
+  tags:
21
+    - dependencies
8 22
 
9 23
 - name: Create dspam directory
10 24
   file: state=directory path=/decrypted/dspam group=dspam owner=dspam

+ 2
- 0
roles/mailserver/tasks/main.yml View File

@@ -1,8 +1,10 @@
1 1
 - include: postfix.yml tags=postfix
2 2
 - include: dovecot.yml tags=dovecot
3 3
 - include: opendkim.yml tags=opendkim
4
+- include: dmarc.yml tags=dmarc
4 5
 - include: dspam.yml tags=dspam
5 6
 - include: solr.yml tags=solr
6 7
 - include: checkrbl.yml tags=checkrbl
7 8
 - include: z-push.yml tags=zpush
8 9
 - include: autoconfig.yml tags=autoconfig
10
+

+ 2
- 0
roles/mailserver/tasks/opendkim.yml View File

@@ -6,6 +6,8 @@
6 6
   with_items:
7 7
     - opendkim
8 8
     - opendkim-tools
9
+  tags:
10
+    - dependencies
9 11
 
10 12
 - name: Create OpenDKIM config directory
11 13
   file: state=directory path=/etc/opendkim group=opendkim owner=opendkim

+ 20
- 15
roles/mailserver/tasks/postfix.yml View File

@@ -1,28 +1,33 @@
1
-- name: Install Postfix 9.1 and related packages for distributions other than Ubuntu Trusty
2
-  apt: pkg={{ item }} state=installed
3
-  with_items:
4
-    - libsasl2-modules
5
-    - postfix
6
-    - postfix-pcre
7
-    - postfix-pgsql
8
-    - postgresql-9.1
9
-    - postgrey
10
-    - python-psycopg2
11
-    - sasl2-bin
12
-  when: ansible_distribution_release != 'trusty'
1
+- name: Install Postgres 9.1 on older distributions
2
+  apt: pkg=postgresql-9.1 state=present
3
+  when: ansible_distribution_release != 'trusty' and ansible_distribution_release != 'jessie'
4
+  tags:
5
+    - dependencies
6
+
7
+- name: Install Postgres 9.3 on Ubuntu Trusty
8
+  apt: pkg=postgresql-9.3 state=present
9
+  when: ansible_distribution_release == 'trusty'
10
+  tags:
11
+    - dependencies
12
+
13
+- name: Install Postgres 9.4 on Debian Jessie
14
+  apt: pkg=postgresql-9.4 state=present
15
+  when: ansible_distribution_release == 'jessie'
16
+  tags:
17
+    - dependencies
13 18
 
14
-- name: Install Postfix 9.3 and related packages for Ubuntu Trusty
19
+- name: Install Postfix and related packages
15 20
   apt: pkg={{ item }} state=installed
16 21
   with_items:
17 22
     - libsasl2-modules
18 23
     - postfix
19 24
     - postfix-pcre
20 25
     - postfix-pgsql
21
-    - postgresql-9.3
22 26
     - postgrey
23 27
     - python-psycopg2
24 28
     - sasl2-bin
25
-  when: ansible_distribution_release == 'trusty'
29
+  tags:
30
+    - dependencies
26 31
 
27 32
 - name: Set postgres password
28 33
   command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with  password '{{ db_admin_password }}';"

+ 13
- 1
roles/mailserver/tasks/solr.yml View File

@@ -1,8 +1,20 @@
1
-- name: Install Solr and related packages
1
+- name: Install Solr and related packages on wheezy from backports
2
+  apt: pkg={{ item }} state=installed default_release=wheezy-backports
3
+  with_items:
4
+    - dovecot-solr
5
+    - solr-tomcat
6
+  when: ansible_distribution_release == 'wheezy'
7
+  tags:
8
+    - dependencies
9
+
10
+- name: Install Solr and related packages on distributions other than wheezy
2 11
   apt: pkg={{ item }} state=installed
3 12
   with_items:
4 13
     - dovecot-solr
5 14
     - solr-tomcat
15
+  when: ansible_distribution_release != 'wheezy'
16
+  tags:
17
+    - dependencies
6 18
 
7 19
 - name: Work around Debian bug and copy Solr schema file into place
8 20
   copy: src=solr-schema.xml dest=/etc/solr/conf/schema.xml group=root owner=root

+ 9
- 1
roles/mailserver/tasks/z-push.yml View File

@@ -5,6 +5,8 @@
5 5
     - php5
6 6
     - php5-cli
7 7
     - php5-imap
8
+  tags:
9
+    - dependencies
8 10
 
9 11
 - name: Download z-push release
10 12
   get_url:
@@ -12,16 +14,22 @@
12 14
     dest=/root/z-push-{{ zpush_version }}.tar.gz
13 15
 
14 16
 - name: Decompress z-push source
15
-  command: tar xzf z-push-{{ zpush_version }}.tar.gz chdir=/root creates=/root/z-push-{{ zpush_version }}
17
+  unarchive: src=/root/z-push-{{ zpush_version }}.tar.gz
18
+             dest=/root copy=no
19
+             creates=/root/z-push-{{ zpush_version }}
16 20
 
17 21
 - name: Create /usr/share/z-push
18 22
   file: state=directory path=/usr/share/z-push
19 23
 
20 24
 - name: Copy z-push source files to /usr/share/z-push
21 25
   shell: cp -R z-push-{{ zpush_version }}/* /usr/share/z-push/ chdir=/root
26
+  tags:
27
+    - skip_ansible_lint
22 28
 
23 29
 - name: Remove downloaded, temporary z-push source files
24 30
   shell: rm -rf z-push* chdir=/root
31
+  tags:
32
+    - skip_ansible_lint
25 33
 
26 34
 - name: Ensure z-push state and log directories are in place
27 35
   file: state=directory path={{ item }} owner=www-data group=www-data mode=755

+ 1
- 8
roles/mailserver/templates/etc_apache2_sites-available_autoconfig.j2 View File

@@ -18,14 +18,7 @@
18 18
 <VirtualHost *:443>
19 19
     ServerName {{ mail_server_autoconfig_hostname }}
20 20
 
21
-    SSLEngine on
22
-    SSLProtocol ALL -SSLv2 -SSLv3
23
-    SSLHonorCipherOrder On
24
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
25
-    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
26
-    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
27
-    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
28
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
21
+    Include /etc/apache2/ssl.conf
29 22
 
30 23
     DocumentRoot            "/var/www/autoconfig"
31 24
     Options                 -Indexes

+ 2
- 2
roles/mailserver/templates/etc_opendkim_TrustedHosts.j2 View File

@@ -4,5 +4,5 @@
4 4
 {{ domain.name }}
5 5
 {% endfor %}
6 6
 {% for domain in mail_virtual_domains %}
7
-mail.{{ domain.name }}
8
-{% endfor %}
7
+{{ mail_server_hostname }}
8
+{% endfor %}

+ 85
- 0
roles/mailserver/templates/etc_opendmarc.conf.j2 View File

@@ -0,0 +1,85 @@
1
+# This is a basic configuration that can easily be adapted to suit a standard
2
+# installation. For more advanced options, see opendkim.conf(5) and/or
3
+# /usr/share/doc/opendmarc/examples/opendmarc.conf.sample.
4
+
5
+##  AuthservID (string)
6
+##      defaults to MTA name
7
+#
8
+AuthservID {{ mail_server_hostname }}
9
+
10
+##  ForensicReports { true | false }
11
+##      default "false"
12
+##
13
+# ForensicReports false
14
+
15
+PidFile /var/run/opendmarc.pid
16
+
17
+##  RejectFailures { true | false }
18
+##      default "false"
19
+##
20
+RejectFailures false
21
+
22
+##  Syslog { true | false }
23
+##      default "false"
24
+##
25
+##  Log via calls to syslog(3) any interesting activity.
26
+#
27
+Syslog true
28
+
29
+##  SyslogFacility facility-name
30
+##      default "mail"
31
+##
32
+##  Log via calls to syslog(3) using the named facility.  The facility names
33
+##  are the same as the ones allowed in syslog.conf(5).
34
+#
35
+# SyslogFacility mail
36
+
37
+##  TrustedAuthservIDs string
38
+##      default HOSTNAME
39
+##
40
+##  Specifies one or more "authserv-id" values to trust as relaying true
41
+##  upstream DKIM and SPF results.  The default is to use the name of
42
+##  the MTA processing the message.  To specify a list, separate each entry
43
+##  with a comma.  The key word "HOSTNAME" will be replaced by the name of
44
+##  the host running the filter as reported by the gethostname(3) function.
45
+#
46
+TrustedAuthservIDs {{ mail_server_hostname }}
47
+
48
+
49
+##  UMask mask
50
+##      default (none)
51
+##
52
+##  Requests a specific permissions mask to be used for file creation.  This
53
+##  only really applies to creation of the socket when Socket specifies a
54
+##  UNIX domain socket, and to the HistoryFile and PidFile (if any); temporary
55
+##  files are normally created by the mkstemp(3) function that enforces a
56
+##  specific file mode on creation regardless of the process umask.  See
57
+##  umask(2) for more information.
58
+#
59
+UMask 0002
60
+
61
+##  UserID user[:group]
62
+##      default (none)
63
+##
64
+##  Attempts to become the specified userid before starting operations.
65
+##  The process will be assigned all of the groups and primary group ID of
66
+##  the named userid unless an alternate group is specified.
67
+#
68
+UserID opendmarc:opendmarc
69
+
70
+## The path to the Ignored Hosts list. This file should contain a list of
71
+## networks and hosts that you trust. Their mail will not be checked by
72
+## OpenDMARC.
73
+#
74
+IgnoreHosts /etc/opendmarc/ignore.hosts
75
+
76
+## The path under which the History file should be created.
77
+## This file is necessary if you want to be able to create aggregate
78
+## reports to send out to other organizations
79
+#
80
+HistoryFile /var/run/opendmarc/opendmarc.dat
81
+
82
+## Adds a “Dmarc-Filter” header with the opendmarc version in every processed mail.
83
+## This is good to have during testing.
84
+#
85
+SoftwareHeader true

+ 4
- 0
roles/mailserver/templates/etc_opendmarc_ignore.hosts.j2 View File

@@ -0,0 +1,4 @@
1
+localhost
2
+10.0.0.0/24
3
+{{ ansible_default_ipv4.address }}
4
+{{ "/n".join(friendly_networks) }}

+ 20
- 0
roles/mailserver/templates/etc_opendmarc_report.sh.j2 View File

@@ -0,0 +1,20 @@
1
+#!/bin/bash
2
+
3
+DB_SERVER='localhost'
4
+DB_USER='{{ mail_db_opendmarc_username }}'
5
+DB_PASS='{{ mail_db_opendmarc_password }}'
6
+DB_NAME='{{ mail_db_opendmarc_database }}'
7
+WORK_DIR='/var/run/opendmarc'
8
+REPORT_EMAIL='{{ admin_email }}'
9
+
10
+mv ${WORK_DIR}/opendmarc.dat ${WORK_DIR}/opendmarc_import.dat -f
11
+touch ${WORK_DIR}/opendmarc.dat
12
+chown opendmarc:opendmarc ${WORK_DIR}/opendmarc.dat
13
+
14
+/usr/sbin/opendmarc-import --dbhost=${DB_SERVER} --dbuser=${DB_USER} --dbpasswd=${DB_PASS} --dbname=${DB_NAME} --verbose < ${WORK_DIR}/opendmarc_import.dat
15
+
16
+{% for domain in mail_virtual_domains %}
17
+/usr/sbin/opendmarc-reports --dbhost=${DB_SERVER} --dbuser=${DB_USER} --dbpasswd=${DB_PASS} --dbname=${DB_NAME} --verbose --interval=86400 --report-email $REPORT_EMAIL --report-org '{{ domain.name }}'
18
+{% endfor %}
19
+
20
+/usr/sbin/opendmarc-expire --dbhost=${DB_SERVER} --dbuser=${DB_USER} --dbpasswd=${DB_PASS} --dbname=${DB_NAME} --verbose

+ 5
- 3
roles/mailserver/templates/etc_postfix_main.cf.j2 View File

@@ -91,15 +91,17 @@ recipient_delimiter = +
91 91
 inet_interfaces = all
92 92
 
93 93
 # dovecot db
94
-virtual_transport = dovecot
94
+virtual_transport = lmtp:unix:private/dovecot-lmtp
95
+mailbox_transport = lmtp:unix:private/dovecot-lmtp
96
+
95 97
 dovecot_destination_recipient_limit = 1
96 98
 virtual_mailbox_domains = pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf
97 99
 virtual_mailbox_maps = pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf
98 100
 virtual_alias_maps = pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf
99 101
 local_recipient_maps = $virtual_mailbox_maps
100 102
 
101
-# OpenDKIM
102
-smtpd_milters = inet:127.0.0.1:8891
103
+# OpenDKIM and OpenDMARC
104
+smtpd_milters = inet:127.0.0.1:8891,inet:127.0.0.1:54321
103 105
 non_smtpd_milters = $smtpd_milters
104 106
 milter_default_action = accept
105 107
 

+ 26
- 5
roles/monitoring/tasks/collectd.yml View File

@@ -1,17 +1,37 @@
1
-- name: Install collectd dependencies
1
+- name: Add wheezy-backports to be compatible with Dovecot packages on Debian 7
2
+  apt_repository: repo='deb http://http.debian.net/debian wheezy-backports main'
3
+  when: ansible_distribution_release == 'wheezy'
4
+  tags:
5
+    - dependencies
6
+
7
+- name: Install collectd dependencies on wheezy from backports
8
+  apt: pkg={{ item }} state=installed default_release=wheezy-backports
9
+  with_items:
10
+    - libcurl4-openssl-dev
11
+    - librrd2-dev
12
+    - python-dev
13
+  when: ansible_distribution_release == 'wheezy'
14
+  tags:
15
+    - dependencies
16
+
17
+- name: Install collectd dependencies on distributions other than wheezy
2 18
   apt: pkg={{ item }} state=installed
3 19
   with_items:
4 20
     - libcurl4-openssl-dev
5 21
     - librrd2-dev
6 22
     - python-dev
23
+  when: ansible_distribution_release != 'wheezy'
24
+  tags:
25
+    - dependencies
7 26
 
8 27
 - name: Download collectd
9 28
   get_url: url=http://collectd.org/files/collectd-{{collectd_version}}.tar.gz
10 29
            dest=/root/collectd-{{collectd_version}}.tar.gz
11 30
 
12 31
 - name: Extract collectd
13
-  command: tar xzf collectd-{{collectd_version}}.tar.gz
14
-           chdir=/root creates=/root/collectd-{{collectd_version}}
32
+  unarchive: src=/root/collectd-{{collectd_version}}.tar.gz
33
+             dest=/root copy=no
34
+             creates=/root/collectd-{{collectd_version}}
15 35
 
16 36
 - name: Build and install collectd
17 37
   shell: ./configure ; make all ; make install
@@ -28,8 +48,9 @@
28 48
   when: collectd_librato_email|length > 0
29 49
 
30 50
 - name: Extract collectd-librato plugin
31
-  command: tar xzf collectd-librato-{{collectd_librato_version}}.tar.gz
32
-           chdir=/root creates=/root/collectd-librato-{{collectd_librato_version}}
51
+  unarchive: src=/root/collectd-librato-{{collectd_librato_version}}.tar.gz
52
+             dest=/root copy=no
53
+             creates=/root/collectd-librato-{{collectd_librato_version}}
33 54
   when: collectd_librato_email|length > 0
34 55
 
35 56
 - name: Install collectd-librato plugin

+ 2
- 0
roles/monitoring/tasks/logwatch.yml View File

@@ -3,6 +3,8 @@
3 3
   with_items:
4 4
     - libdate-manip-perl
5 5
     - logwatch
6
+  tags:
7
+    - dependencies
6 8
 
7 9
 - name: Configure logwatch
8 10
   template: src=etc_logwatch_conf_logwatch.conf.j2 dest=/etc/logwatch/conf/logwatch.conf

+ 2
- 0
roles/monitoring/tasks/monit.yml View File

@@ -7,6 +7,8 @@
7 7
 
8 8
 - name: Install monit
9 9
   apt: pkg=monit state=installed
10
+  tags:
11
+    - dependencies
10 12
 
11 13
 - name: Copy monit master config file into place
12 14
   copy: src=etc_monit_monitrc dest=/etc/monit/monitrc

+ 2
- 0
roles/newebe/tasks/newebe.yml View File

@@ -15,6 +15,8 @@
15 15
     - python-setuptools
16 16
     - python-lxml
17 17
     - supervisor
18
+  tags:
19
+    - dependencies
18 20
 
19 21
 - name: Install Newebe
20 22
   pip: name='git+https://github.com/gelnior/newebe.git#egg=newebe'

+ 2
- 9
roles/newebe/templates/etc_apache2_sites-available_newebe.j2 View File

@@ -7,15 +7,8 @@
7 7
 <VirtualHost *:443>
8 8
 
9 9
     ServerName {{ newebe_domain }}
10
-    SSLEngine On
11
-
12
-    SSLProtocol ALL -SSLv2 -SSLv3
13
-    SSLHonorCipherOrder On
14
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
15
-    SSLCertificateFile /etc/ssl/certs/wildcard_public_cert.crt
16
-    SSLCertificateKeyFile /etc/ssl/private/wildcard_private.key
17
-    SSLCACertificateFile /etc/ssl/certs/wildcard_ca.pem
18
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
10
+
11
+    Include /etc/apache2/ssl.conf
19 12
 
20 13
     ErrorLog /var/log/apache2/newebe.info-error_log
21 14
     CustomLog /var/log/apache2/newebe.info-access_log common

+ 18
- 4
roles/news/tasks/selfoss.yml View File

@@ -2,9 +2,21 @@
2 2
   git: repo=https://github.com/SSilence/selfoss.git
3 3
        dest=/var/www/selfoss
4 4
        accept_hostkey=yes
5
+       version=master
5 6
 
6
-- name: Set selfoss permissions
7
-  action: file owner=www-data group=www-data path=/var/www/selfoss recurse=yes state=directory
7
+- name: Set selfoss ownership
8
+  action: file owner=root group=www-data path=/var/www/selfoss recurse=yes state=directory
9
+
10
+# only data/cache, data/favicons, data/logs, data/thumbnails, data/sqlite public/ should be writeable by httpd
11
+- name: Set selfoss permission
12
+  action: file path=/var/www/selfoss/{{ item }} mode=0775
13
+  with_items:
14
+    - data/cache
15
+    - data/favicons
16
+    - data/logs
17
+    - data/thumbnails
18
+    - data/sqlite
19
+    - public
8 20
 
9 21
 - name: Install selfoss dependencies
10 22
   apt: pkg={{ item }} state=present
@@ -12,6 +24,8 @@
12 24
     - php5
13 25
     - php5-pgsql
14 26
     - php5-gd
27
+  tags:
28
+    - dependencies
15 29
 
16 30
 - name: Create database user for selfoss
17 31
   postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ selfoss_db_username }} password="{{ selfoss_db_password }}" state=present
@@ -20,7 +34,7 @@
20 34
   postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ selfoss_db_database }} state=present owner={{ selfoss_db_username }}
21 35
 
22 36
 - name: Install selfoss config.ini
23
-  template: src=var_www_selfoss_config.ini.j2 dest=/var/www/selfoss/config.ini group=www-data owner=www-data
37
+  template: src=var_www_selfoss_config.ini.j2 dest=/var/www/selfoss/config.ini group=www-data owner=root
24 38
 
25 39
 - name: Enable Apache rewrite module
26 40
   command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
@@ -38,7 +52,7 @@
38 52
   command: mv /etc/apache2/sites-available/selfoss /etc/apache2/sites-available/selfoss.conf removes=/etc/apache2/sites-available/selfoss
39 53
 
40 54
 - name: Remove old sites-enabled/selfoss symlink (new one will be created by a2ensite)
41
-  command: rm /etc/apache2/sites-enabled/selfoss removes=/etc/apache2/sites-enabled/selfoss
55
+  file: path=/etc/apache2/sites-enabled/selfoss state=absent
42 56
 
43 57
 - name: Configure the Apache HTTP server for selfoss
44 58
   template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss.conf group=root owner=root

+ 1
- 8
roles/news/templates/etc_apache2_sites-available_selfoss.j2 View File

@@ -7,14 +7,7 @@
7 7
 <VirtualHost *:443>
8 8
     ServerName {{ selfoss_domain }}
9 9
 
10
-    SSLEngine on
11
-    SSLProtocol ALL -SSLv2 -SSLv3
12
-    SSLHonorCipherOrder On
13
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
14
-    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
15
-    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
16
-    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
17
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
10
+    Include /etc/apache2/ssl.conf
18 11
 
19 12
     DocumentRoot            /var/www/selfoss
20 13
     Options                 -Indexes

+ 21
- 1
roles/owncloud/tasks/owncloud.yml View File

@@ -5,10 +5,14 @@
5 5
 - name: Install Postgres 9.1 on distributions other than Ubuntu Trusty
6 6
   apt: pkg=postgresql-9.1 state=present
7 7
   when: ansible_distribution_release != 'trusty'
8
+  tags:
9
+    - dependencies
8 10
 
9 11
 - name: Install Postgres 9.3 on Ubuntu Trusty
10 12
   apt: pkg=postgresql-9.3 state=present
11 13
   when: ansible_distribution_release == 'trusty'
14
+  tags:
15
+    - dependencies
12 16
 
13 17
 - name: Install ownCloud dependencies
14 18
   apt: pkg={{ item }} state=present
@@ -16,6 +20,8 @@
16 20
     - libapache2-mod-php5
17 21
     - php-apc
18 22
     - python-psycopg2
23
+  tags:
24
+    - dependencies
19 25
 
20 26
 - name: Set postgres password
21 27
   command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with  password '{{ db_admin_password }}';"
@@ -29,29 +35,43 @@
29 35
 - name: Ensure repository key for ownCloud is in place for Debian 7
30 36
   apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key state=present
31 37
   when: ansible_distribution_release == 'wheezy'
38
+  tags:
39
+    - dependencies
32 40
 
33 41
 - name: Add ownCloud OpenSuSE repository for Debian 7
34 42
   apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /'
35 43
   when: ansible_distribution_release == 'wheezy'
44
+  tags:
45
+    - dependencies
36 46
 
37 47
 - name: Ensure repository key for ownCloud is in place for Ubuntu 14.04
38 48
   apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key state=present
39 49
   when: ansible_distribution_release == 'trusty'
50
+  tags:
51
+    - dependencies
40 52
 
41 53
 - name: Add ownCloud OpenSuSE repository for Ubuntu 14.04
42 54
   apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/ /'
43 55
   when: ansible_distribution_release == 'trusty'
56
+  tags:
57
+    - dependencies
44 58
 
45 59
 - name: Ensure repository key for ownCloud is in place for Ubuntu 12.04
46 60
   apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key state=present
47 61
   when: ansible_distribution_release == 'precise'
62
+  tags:
63
+    - dependencies
48 64
 
49 65
 - name: Add ownCloud OpenSuSE repository for Ubuntu 12.04
50 66
   apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/ /'
51 67
   when: ansible_distribution_release == 'precise'
68
+  tags:
69
+    - dependencies
52 70
 
53 71
 - name: Install ownCloud (possibly from OpenSuSE repository)
54 72
   apt: pkg=owncloud update_cache=yes
73
+  tags:
74
+    - dependencies
55 75
 
56 76
 - name: Owncloud www directory
57 77
   file: state=directory path=/var/www/owncloud
@@ -76,7 +96,7 @@
76 96
   command: mv /etc/apache2/sites-available/owncloud /etc/apache2/sites-available/owncloud.conf removes=/etc/apache2/sites-available/owncloud
77 97
 
78 98
 - name: Remove old sites-enabled/owncloud symlink (new one will be created by a2ensite)
79
-  command: rm /etc/apache2/sites-enabled/owncloud removes=/etc/apache2/sites-enabled/owncloud
99
+  file: path=/etc/apache2/sites-enabled/owncloud state=absent
80 100
 
81 101
 - name: Configure the Apache HTTP server for ownCloud
82 102
   template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root owner=root

+ 1
- 8
roles/owncloud/templates/etc_apache2_sites-available_owncloud.j2 View File

@@ -7,14 +7,7 @@
7 7
 <VirtualHost *:443>
8 8
     ServerName {{ owncloud_domain }}
9 9
 
10
-    SSLEngine on
11
-    SSLProtocol ALL -SSLv2 -SSLv3
12
-    SSLHonorCipherOrder On
13
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
14
-    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
15
-    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
16
-    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
17
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
10
+    Include /etc/apache2/ssl.conf
18 11
 
19 12
     DocumentRoot            /var/www/owncloud
20 13
     Options                 -Indexes

+ 24
- 8
roles/readlater/tasks/wallabag.yml View File

@@ -20,6 +20,8 @@
20 20
     - php5-mcrypt
21 21
     - php5-pgsql
22 22
     - php5-tidy
23
+  tags:
24
+    - dependencies
23 25
 
24 26
 - name: Create database user for wallabag
25 27
   postgresql_user: login_host=localhost
@@ -38,34 +40,48 @@
38 40
                  owner={{ wallabag_db_username }}
39 41
   notify: import wallabag sql
40 42
 
41
-- name: Build Composer
42
-  shell: curl -sS https://getcomposer.org/installer | php
43
-         chdir=/root
44
-         creates=/root/composer.phar
43
+- name: Get Composer installer
44
+  get_url: url=https://getcomposer.org/installer
45
+           dest=/tmp/composer-installer
46
+
47
+- name: Install Composer
48
+  command: php /tmp/composer-installer
49
+           chdir=/root
50
+           creates=/root/composer.phar
45 51
 
46 52
 - name: Initialize composer
47 53
   command: php /root/composer.phar install
48 54
            chdir=/var/www/wallabag
49 55
            creates=/var/www/wallabag/vendor/autoload.php
50 56
 
51
-- name: Set wallabag permissions
52
-  file: owner=www-data
57
+- name: Set wallabag ownership
58
+  file: owner=root
53 59
         group=www-data
54 60
         path=/var/www/wallabag
55 61
         recurse=yes
56 62
         state=directory
57 63
 
64
+# the httpd only needs write access to the wallabag assets, cache and db directories
65
+- name: Set wallabag assets, cache and db permissions
66
+  file: path=/var/www/wallabag/{{ item }}
67
+        mode=0775
68
+        state=directory
69
+  with_items:
70
+    - assets
71
+    - cache
72
+    - db
73
+
58 74
 - name: Create the configuration file
59 75
   template: src=var_www_wallabag_inc_poche_config.inc.php.j2
60 76
             dest=/var/www/wallabag/inc/poche/config.inc.php
61
-            owner=www-data
77
+            owner=root
62 78
             group=www-data
63 79
 
64 80
 - name: Rename existing Apache wallabag virtualhost
65 81
   command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
66 82
 
67 83
 - name: Remove old sites-enabled/wallabag symlink (new one will be created by a2ensite)
68
-  command: rm /etc/apache2/sites-enabled/wallabag removes=/etc/apache2/sites-enabled/wallabag
84
+  file: path=/etc/apache2/sites-enabled/wallabag state=absent
69 85
 
70 86
 - name: Configure the Apache HTTP server for wallabag
71 87
   template: src=etc_apache2_sites-available_wallabag.j2

+ 1
- 8
roles/readlater/templates/etc_apache2_sites-available_wallabag.j2 View File

@@ -7,14 +7,7 @@
7 7
 <VirtualHost *:443>
8 8
     ServerName {{ wallabag_domain }}
9 9
 
10
-    SSLEngine on
11
-    SSLProtocol ALL -SSLv2 -SSLv3
12
-    SSLHonorCipherOrder On
13
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
14
-    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
15
-    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
16
-    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
17
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
10
+    Include /etc/apache2/ssl.conf
18 11
 
19 12
     DocumentRoot            /var/www/wallabag
20 13
     Options                 -Indexes

+ 19
- 13
roles/tarsnap/tasks/tarsnap.yml View File

@@ -1,66 +1,72 @@
1 1
 - name: Check if tarsnap {{ tarsnap_version }} is installed
2 2
   shell: tarsnap --version | grep {{ tarsnap_version }} --color=never
3
-  register: tarnsap_installed
4
-  changed_when: "tarnsap_installed.stderr != ''"
3
+  register: tarsnap_installed
4
+  changed_when: "tarsnap_installed.stderr != ''"
5 5
   ignore_errors: yes
6
+  tags:
7
+    - dependencies
6 8
 
7 9
 - name: Install dependencies for Tarsnap
8
-  when: tarnsap_installed|failed
10
+  when: tarsnap_installed|failed
9 11
   apt: pkg={{ item }} state=installed
10 12
   with_items:
11 13
     - e2fslibs-dev
12 14
     - libssl-dev
13 15
     - zlib1g-dev
16
+  tags:
17
+    - dependencies
14 18
 
15 19
 - name: Download the current tarsnap code signing key
16
-  when: tarnsap_installed|failed
20
+  when: tarsnap_installed|failed
17 21
   get_url:
18 22
     url=https://www.tarsnap.com/tarsnap-signing-key.asc
19 23
     dest=/root/tarsnap-signing-key.asc
20 24
 
21 25
 - name: Add the tarsnap code signing key to your list of keys
22
-  when: tarnsap_installed|failed
26
+  when: tarsnap_installed|failed
23 27
   command:
24 28
     gpg --import tarsnap-signing-key.asc
25 29
     chdir=/root/
26 30
 
27 31
 - name: Download tarsnap SHA file
28
-  when: tarnsap_installed|failed
32
+  when: tarsnap_installed|failed
29 33
   get_url:
30 34
     url="https://www.tarsnap.com/download/tarsnap-sigs-{{ tarsnap_version }}.asc"
31 35
     dest="/root/tarsnap-sigs-{{ tarsnap_version }}.asc"
32 36
 
33 37
 - name: Make the command that gets the current sha
34
-  when: tarnsap_installed|failed
38
+  when: tarsnap_installed|failed
35 39
   template:
36 40
     src=getSha.sh
37 41
     dest=/root/getSha.sh
38 42
     mode=0755
39 43
 
40 44
 - name: get the SHA256sum for this tarsnap release
41
-  when: tarnsap_installed|failed
45
+  when: tarsnap_installed|failed
42 46
   command:
43 47
     ./getSha.sh
44 48
     chdir=/root
45 49
   register: tarsnap_sha
46 50
 
47 51
 - name: Download Tarsnap source
48
-  when: tarnsap_installed|failed
52
+  when: tarsnap_installed|failed
49 53
   get_url:
50 54
     url="https://www.tarsnap.com/download/tarsnap-autoconf-{{ tarsnap_version }}.tgz"
51 55
     dest="/root/tarsnap-autoconf-{{ tarsnap_version }}.tgz"
52 56
     sha256sum={{ tarsnap_sha.stdout_lines[0] }}
53 57
 
54 58
 - name: Decompress Tarsnap source
55
-  when: tarnsap_installed|failed
56
-  command: tar xzf /root/tarsnap-autoconf-{{ tarsnap_version }}.tgz chdir=/root creates=/root/tarsnap-autoconf-{{ tarsnap_version }}/COPYING
59
+  when: tarsnap_installed|failed
60
+  unarchive: src=/root/tarsnap-autoconf-{{ tarsnap_version }}.tgz
61
+             dest=/root copy=no
62
+             creates=/root/tarsnap-autoconf-{{ tarsnap_version }}/COPYING
57 63
 
58 64
 - name: Configure Tarsnap for local build
59
-  when: tarnsap_installed|failed
65
+  when: tarsnap_installed|failed
60 66
   command: ./configure chdir=/root/tarsnap-autoconf-{{ tarsnap_version }} creates=/root/tarsnap-autoconf-{{ tarsnap_version }}/Makefile
61 67
 
62 68
 - name: Build and install Tarsnap
63
-  when: tarnsap_installed|failed
69
+  when: tarsnap_installed|failed
64 70
   command: make all install clean chdir=/root/tarsnap-autoconf-{{ tarsnap_version }} creates=/usr/local/bin/tarsnap
65 71
 
66 72
 - name: Copy Tarsnap key file into place

+ 4
- 0
roles/vpn/tasks/openvpn.yml View File

@@ -8,6 +8,8 @@
8 8
     - dnsmasq
9 9
     - openvpn
10 10
     - udev
11
+  tags:
12
+    - dependencies
11 13
 
12 14
 - name: Generate RSA keys for the CA and Server
13 15
   command: openssl genrsa -out {{ item }}.key {{ openvpn_key_size }}
@@ -152,6 +154,8 @@
152 154
 
153 155
 - name: Copy the ca.crt and ta.key files that clients will need in order to connect to the OpenVPN server
154 156
   command: cp {{ openvpn_path }}/{{ item[1] }} {{ openvpn_path }}/{{ item[0] }}
157
+  tags:
158
+    - skip_ansible_lint
155 159
   with_nested:
156 160
     - openvpn_clients
157 161
     - ["ca.crt", "ta.key"]

+ 14
- 3
roles/webmail/tasks/roundcube.yml View File

@@ -1,9 +1,13 @@
1 1
 - name: Add backports for Roundcube on Debian
2 2
   lineinfile: dest=/etc/apt/sources.list line="deb http://http.debian.net/debian wheezy-backports main"
3 3
   when: ansible_distribution_release == 'wheezy'
4
-  
4
+  tags:
5
+    - dependencies
6
+
5 7
 - name: Update apt cache for backports
6 8
   apt: update_cache=yes
9
+  tags:
10
+    - dependencies
7 11
 
8 12
 - name: Install Roundcube from wheezy-backports
9 13
   apt: pkg={{ item }} state=latest default_release=wheezy-backports
@@ -12,6 +16,8 @@
12 16
   - roundcube-pgsql
13 17
   - roundcube-plugins
14 18
   when: ansible_distribution_release == 'wheezy'
19
+  tags:
20
+    - dependencies
15 21
 
16 22
 - name: Install Roundcube on Ubuntu 14.04 LTS
17 23
   apt: pkg={{ item }} state=latest
@@ -20,6 +26,8 @@
20 26
   - roundcube-pgsql
21 27
   - roundcube-plugins
22 28
   when: ansible_distribution_release == 'trusty'
29
+  tags:
30
+    - dependencies
23 31
 
24 32
 - name: Configure Roundcube database
25 33
   template: src={{ item.src }} dest={{ item.dest }} group={{ item.group }} mode={{ item.mode }} owner=root force=yes
@@ -34,7 +42,9 @@
34 42
     dest=/root/carddav_{{ carddav_version }}.tar.gz
35 43
 
36 44
 - name: Decompress carddav plugin source
37
-  command: tar xzf carddav_{{ carddav_version }}.tar.gz chdir=/root creates=/root/rcmcarddav-carddav_{{ carddav_version }}
45
+  unarchive: src=/root/carddav_{{ carddav_version }}.tar.gz
46
+             dest=/root copy=no
47
+             creates=/root/rcmcarddav-carddav_{{ carddav_version }}
38 48
 
39 49
 - name: Move carddav plugin files to /usr/share/roundcube/plugins/carddav
40 50
   command: mv rcmcarddav-carddav_{{ carddav_version }} /usr/share/roundcube/plugins/carddav chdir=/root creates=/usr/share/roundcube/plugins/carddav
@@ -43,6 +53,7 @@
43 53
   git: repo=https://github.com/alexandregz/twofactor_gauthenticator.git
44 54
        dest=/usr/share/roundcube/plugins/twofactor_gauthenticator
45 55
        accept_hostkey=yes
56
+       version=master
46 57
 
47 58
 - name: Link plugins into /var/lib/roundcube/plugins
48 59
   file: state=link src=/usr/share/roundcube/plugins/{{ item }} dest=/var/lib/roundcube/plugins/{{ item }} force=yes
@@ -54,7 +65,7 @@
54 65
   command: mv /etc/apache2/sites-available/roundcube /etc/apache2/sites-available/roundcube.conf removes=/etc/apache2/sites-available/roundcube
55 66
 
56 67
 - name: Remove old sites-enabled/roundcube symlink (new one will be created by a2ensite)
57
-  command: rm /etc/apache2/sites-enabled/roundcube removes=/etc/apache2/sites-enabled/roundcube
68
+  file: path=/etc/apache2/sites-enabled/roundcube state=absent
58 69
 
59 70
 - name: Configure the Apache HTTP server for roundcube
60 71
   template: src=etc_apache2_sites-available_roundcube.j2 dest=/etc/apache2/sites-available/roundcube.conf group=root owner=root force=yes

+ 1
- 8
roles/webmail/templates/etc_apache2_sites-available_roundcube.j2 View File

@@ -7,14 +7,7 @@
7 7
 <VirtualHost *:443>
8 8
     ServerName {{ webmail_domain }}
9 9
 
10
-    SSLEngine on
11
-    SSLProtocol ALL -SSLv2 -SSLv3
12
-    SSLHonorCipherOrder On
13
-    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
14
-    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
15
-    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
16
-    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
17
-    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
10
+    Include /etc/apache2/ssl.conf
18 11
 
19 12
     # Those aliases do not work properly with several hosts on your apache server
20 13
     # Uncomment them to use it or adapt them to your configuration

+ 19
- 0
roles/xmpp/tasks/prosody.yml View File

@@ -1,12 +1,31 @@
1 1
 - name: Ensure repository key for Prosody is in place
2 2
   apt_key: url=https://prosody.im/files/prosody-debian-packages.key state=present
3
+  tags:
4
+    - dependencies
3 5
 
4 6
 # Prosody supplies repo for sid, squeeze, wheezy, jessie, trusty, saucy, raring, quantal, precise and lucid
5 7
 - name: Add Prosody Debian/Ubuntu repository
6 8
   apt_repository: repo="deb http://packages.prosody.im/debian {{ ansible_distribution_release }} main"
9
+  tags:
10
+    - dependencies
7 11
 
8 12
 - name: Install Prosody from official repository
9 13
   apt: pkg=prosody update_cache=yes
14
+  tags:
15
+    - dependencies
16
+
17
+- name: Install lua-sec-prosody on Debian Wheezy and Ubuntu Precise
18
+  apt: pkg=lua-sec-prosody update_cache=yes
19
+  when: ansible_distribution_release == 'wheezy' or ansible_distribution_release == 'precise'
20
+  tags:
21
+    - dependencies
22
+
23
+
24
+- name: Install lua-sec 0.5+
25
+  apt: pkg=lua-sec update_cache=yes
26
+  when: ansible_distribution_release == 'trusty' or ansible_distribution_release == 'jessie'
27
+  tags:
28
+    - dependencies
10 29
 
11 30
 - name: Add prosody user to ssl-cert group
12 31
   user: name=prosody groups=ssl-cert append=yes

+ 5
- 2
vars/defaults.yml View File

@@ -63,6 +63,9 @@ mail_db_database: mailserver
63 63
 # mail_virtual_domains: (required)
64 64
 # mail_virtual_users: (required)
65 65
 # mail_virtual_aliases: (required)
66
+mail_db_opendmarc_username: opendmarc
67
+# mail_db_opendmarc_password: (required)
68
+mail_db_opendmarc_database: opendmarc
66 69
 
67 70
 # z-push
68 71
 zpush_version: 2.1.1-1788
@@ -97,7 +100,7 @@ openvpn_protocol: "udp"
97 100
 # openvpn_clients: (required)
98 101
 
99 102
 # webmail
100
-webmail_domain: "mail.{{ domain }}"
103
+webmail_domain: "{{ mail_server_hostname }}"
101 104
 webmail_db_username: "roundcube"
102 105
 # webmail_db_password: (required)
103 106
 webmail_db_database: "roundcube"
@@ -123,7 +126,7 @@ gitolite_version: 3.5.3.1
123 126
 newebe_domain: "newebe.{{ domain }}"
124 127
 
125 128
 # wallabag
126
-wallabag_version: 1.7.1
129
+wallabag_version: 1.9.1
127 130
 wallabag_domain: "read.{{ domain }}"
128 131
 # wallabag_salt: (required)
129 132
 wallabag_db_username: wallabag

+ 2
- 1
vars/user.yml View File

@@ -7,7 +7,7 @@
7 7
 # common
8 8
 domain: TODO.com
9 9
 main_user_name: TODO
10
-encfs_password: TODO
10
+encfs_password: TODO    # NOTE: must not contain dollar sign characters '$'
11 11
 
12 12
 # database
13 13
 db_admin_username: postgres
@@ -24,6 +24,7 @@ irc_timezone: TODO      #Example: "America/New_York"
24 24
 
25 25
 # mailserver
26 26
 mail_db_password: TODO
27
+mail_db_opendmarc_password: TODO
27 28
 mail_virtual_domains:
28 29
   - name: "{{ domain }}"
29 30
     pk_id: 1

Loading…
Cancel
Save