Browse Source

Merge pull request #242 from neuhaus/patch-2

apache sites: Wrong ownership and filename
Alex Payne 10 years ago
parent
commit
52b23ed631

+ 8
- 3
roles/blog/tasks/blog.yml View File

@@ -1,11 +1,16 @@
1 1
 - name: Create directory for blog HTML
2 2
   file: state=directory path=/var/www/{{ domain }} group=www-data owner=www-data
3 3
 
4
+- name: Rename existing Apache blog virtualhost
5
+  command: mv /etc/apache2/sites-available/{{ domain }} /etc/apache2/sites-available/{{ domain }}.conf removes=/etc/apache2/sites-available/{{ domain }}
6
+
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 }}
9
+
4 10
 - name: Configure the Apache HTTP server for the blog
5
-  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/{{ domain }} group=www-data owner=www-data
6
-  notify: restart apache
11
+  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/{{ domain }}.conf group=root owner=root
7 12
 
8 13
 - name: Enable blog site
9
-  command: a2ensite {{ domain }} creates=/etc/apache2/sites-enabled/{{ domain }}
14
+  command: a2ensite {{ domain }}.conf creates=/etc/apache2/sites-enabled/{{ domain }}.conf
10 15
   notify: restart apache
11 16
 

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

@@ -32,12 +32,17 @@
32 32
             group=www-data
33 33
             owner=www-data
34 34
 
35
+- name: Rename existing Apache cgit virtualhost
36
+  command: mv /etc/apache2/sites-available/cgit /etc/apache2/sites-available/cgit.conf removes=/etc/apache2/sites-available/cgit
37
+
38
+- 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
40
+
35 41
 - name: Configure the Apache HTTP server for cgit
36 42
   template: src=etc_apache2_sites-available_cgit.j2
37
-            dest=/etc/apache2/sites-available/cgit
38
-            group=www-data
39
-            owner=www-data
40
-  notify: restart apache
43
+            dest=/etc/apache2/sites-available/cgit.conf
44
+            group=root
45
+            owner=root
41 46
 
42 47
 - name: Enable Apache cgi module
43 48
   command: a2enmod cgi creates=/etc/apache2/mods-enabled/cgi.load
@@ -48,5 +53,5 @@
48 53
   notify: restart apache
49 54
 
50 55
 - name:  Enable cgit site
51
-  command: a2ensite cgit creates=/etc/apache2/sites-enabled/cgit
56
+  command: a2ensite cgit.conf creates=/etc/apache2/sites-enabled/cgit.conf
52 57
   notify: restart apache

+ 13
- 0
roles/mailserver/tasks/dovecot.yml View File

@@ -8,6 +8,19 @@
8 8
     - dovecot-managesieved
9 9
     - postgresql-9.1
10 10
     - dovecot-pgsql
11
+  when: ansible_distribution_release != 'trusty'
12
+
13
+- name: Install Dovecot and related packages for Ubuntu trusty
14
+  apt: pkg={{ item }} state=installed
15
+  with_items:
16
+    - dovecot-core
17
+    - dovecot-imapd
18
+    - dovecot-pop3d
19
+    - dovecot-lmtpd
20
+    - dovecot-managesieved
21
+    - postgresql-9.3
22
+    - dovecot-pgsql
23
+  when: ansible_distribution_release == 'trusty'
11 24
 
12 25
 - name: Create vmail group
13 26
   group: name=vmail state=present gid=5000

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

@@ -1,4 +1,4 @@
1
-- name: Install Postfix and related packages
1
+- name: Install Postfix 9.1 and related packages
2 2
   apt: pkg={{ item }} state=installed
3 3
   with_items:
4 4
     - postfix
@@ -9,6 +9,20 @@
9 9
     - postfix-pgsql
10 10
     - python-psycopg2
11 11
     - postfix-pcre
12
+  when: ansible_distribution_release != 'trusty'
13
+
14
+- name: Install Postfix 9.3 and related packages for Ubuntu Trusty
15
+  apt: pkg={{ item }} state=installed
16
+  with_items:
17
+    - postfix
18
+    - libsasl2-modules
19
+    - sasl2-bin
20
+    - postgrey
21
+    - postgresql-9.3
22
+    - postfix-pgsql
23
+    - python-psycopg2
24
+    - postfix-pcre
25
+  when: ansible_distribution_release == 'trusty'
12 26
 
13 27
 - name: Set postgres password
14 28
   command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with  password '{{ db_admin_password }}';"

+ 12
- 6
roles/newebe/tasks/main.yml View File

@@ -71,14 +71,20 @@
71 71
 # When Ansible 1.6 will be available  
72 72
 # apache2_module: state=present name=proxy_http
73 73
 #
74
+
75
+- name: Rename existing Apache newebe virtualhost
76
+  command: mv /etc/apache2/sites-available/newebe /etc/apache2/sites-available/newebe.conf removes=/etc/apache2/sites-available/newebe
77
+
78
+- name: Remove old sites-enabled/newebe symlink (new one will be created by a2ensite)
79
+  command: rm /etc/apache2/sites-enabled/newebe removes=/etc/apache2/sites-enabled/newebe
80
+
74 81
 - name: Configure the Apache HTTP server for Newebe
75 82
   template: src=etc_apache2_sites-available_newebe.j2
76
-            dest=/etc/apache2/sites-available/newebe
77
-            group=www-data
78
-            owner=www-data
79
-  notify: restart apache
83
+            dest=/etc/apache2/sites-available/newebe.conf
84
+            group=root
85
+            owner=root
80 86
 
81 87
 - name: Enable the site
82
-  command: a2ensite newebe
83
-           creates=/etc/apache2/sites-enabled/newebe
88
+  command: a2ensite newebe.conf
89
+           creates=/etc/apache2/sites-enabled/newebe.conf
84 90
   notify: restart apache

+ 8
- 3
roles/news/tasks/selfoss.yml View File

@@ -26,12 +26,17 @@
26 26
   command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
27 27
   notify: restart apache
28 28
 
29
+- name: Rename existing Apache blog virtualhost
30
+  command: mv /etc/apache2/sites-available/selfoss /etc/apache2/sites-available/selfoss.conf removes=/etc/apache2/sites-available/selfoss
31
+
32
+- name: Remove old sites-enabled/selfoss symlink (new one will be created by a2ensite)
33
+  command: rm /etc/apache2/sites-enabled/selfoss removes=/etc/apache2/sites-enabled/selfoss
34
+
29 35
 - name: Configure the Apache HTTP server for selfoss
30
-  template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss group=www-data owner=www-data
31
-  notify: restart apache
36
+  template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss.conf group=root owner=root
32 37
 
33 38
 - name: Enable the selfoss site
34
-  command: a2ensite selfoss creates=/etc/apache2/sites-enabled/selfoss
39
+  command: a2ensite selfoss.conf creates=/etc/apache2/sites-enabled/selfoss.conf
35 40
   notify: restart apache
36 41
 
37 42
 - name: Install selfoss cronjob

+ 19
- 6
roles/owncloud/tasks/owncloud.yml View File

@@ -10,15 +10,23 @@
10 10
 
11 11
 - name: Ensure repository key for ownCloud is in place
12 12
   apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key state=present
13
+  when: ansible_distribution == 'Debian'
13 14
 
14 15
 - name: Add ownCloud OpenSuSE repository
15 16
   apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /'
17
+  when: ansible_distribution == 'Debian'
16 18
 
17
-- name: Install ownCloud from OpenSuSE repository
19
+- name: Install ownCloud (possibly from OpenSuSE repository)
18 20
   apt: pkg=owncloud update_cache=yes
19 21
 
20
-- name: Install PHP-APC
21
-  apt: pkg=php-apc
22
+- name: Install PHP dependencies
23
+  apt: pkg={{ item }} state=present
24
+  with_items:
25
+    - php-apc
26
+    - libapache2-mod-php5
27
+
28
+- name: Owncloud www directory
29
+  file: state=directory path=/var/www/owncloud
22 30
 
23 31
 - name: Store ownCloud data securely
24 32
   command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
@@ -36,12 +44,17 @@
36 44
   command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
37 45
   notify: restart apache
38 46
 
47
+- name: Rename existing Apache owncloud virtualhost
48
+  command: mv /etc/apache2/sites-available/owncloud /etc/apache2/sites-available/owncloud.conf removes=/etc/apache2/sites-available/owncloud
49
+
50
+- name: Remove old sites-enabled/owncloud symlink (new one will be created by a2ensite)
51
+  command: rm /etc/apache2/sites-enabled/owncloud removes=/etc/apache2/sites-enabled/owncloud
52
+
39 53
 - name: Configure the Apache HTTP server for ownCloud
40
-  template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud group=www-data owner=www-data
41
-  notify: restart apache
54
+  template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root owner=root
42 55
 
43 56
 - name: Enable the owncloud site
44
-  command: a2ensite owncloud creates=/etc/apache2/sites-enabled/owncloud
57
+  command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
45 58
   notify: restart apache
46 59
 
47 60
 - name: Install ownCloud cronjob

+ 11
- 6
roles/readlater/tasks/wallabag.yml View File

@@ -52,14 +52,19 @@
52 52
             owner=www-data
53 53
             group=www-data
54 54
 
55
+- name: Rename existing Apache wallabag virtualhost
56
+  command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
57
+
58
+- name: Remove old sites-enabled/wallabag symlink (new one will be created by a2ensite)
59
+  command: rm /etc/apache2/sites-enabled/wallabag removes=/etc/apache2/sites-enabled/wallabag
60
+
55 61
 - name: Configure the Apache HTTP server for wallabag
56 62
   template: src=etc_apache2_sites-available_wallabag.j2
57
-            dest=/etc/apache2/sites-available/wallabag
58
-            owner=www-data
59
-            group=www-data
60
-  notify: restart apache
63
+            dest=/etc/apache2/sites-available/wallabag.conf
64
+            owner=root
65
+            group=root
61 66
 
62 67
 - name: Enable the wallabag site
63
-  command: a2ensite wallabag
64
-           creates=/etc/apache2/sites-enabled/wallabag
68
+  command: a2ensite wallabag.conf
69
+           creates=/etc/apache2/sites-enabled/wallabag.conf
65 70
   notify: restart apache

+ 8
- 2
roles/webmail/tasks/roundcube.yml View File

@@ -32,8 +32,14 @@
32 32
     - carddav
33 33
     - twofactor_gauthenticator
34 34
 
35
+- name: Rename existing Apache roundcube virtualhost
36
+  command: mv /etc/apache2/sites-available/roundcube /etc/apache2/sites-available/roundcube.conf removes=/etc/apache2/sites-available/roundcube
37
+
38
+- name: Remove old sites-enabled/roundcube symlink (new one will be created by a2ensite)
39
+  command: rm /etc/apache2/sites-enabled/roundcube removes=/etc/apache2/sites-enabled/roundcube
40
+
35 41
 - name: Configure the Apache HTTP server for roundcube
36
-  template: src=etc_apache2_sites-available_roundcube.j2 dest=/etc/apache2/sites-available/roundcube group=www-data owner=www-data force=yes
42
+  template: src=etc_apache2_sites-available_roundcube.j2 dest=/etc/apache2/sites-available/roundcube.conf group=root owner=root force=yes
37 43
 
38 44
 - name: Configure roundcube
39 45
   copy: src={{ item.src }} dest={{ item.dest }} group=www-data owner=root mode=640 force=yes
@@ -45,6 +51,6 @@
45 51
   - { src: 'etc_roundcube_global.sieve',                                          dest: '/etc/roundcube/global.sieve' }
46 52
 
47 53
 - name: Enable roundcube site
48
-  command: a2ensite roundcube creates=/etc/apache2/sites-enabled/roundcube
54
+  command: a2ensite roundcube.conf creates=/etc/apache2/sites-enabled/roundcube.conf
49 55
   notify: restart apache
50 56
 

+ 3
- 2
roles/xmpp/tasks/prosody.yml View File

@@ -1,8 +1,9 @@
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 3
 
4
-- name: Add Prosody repository
5
-  apt_repository: repo='deb http://packages.prosody.im/debian wheezy main'
4
+# Prosody supplies repo for sid, squeeze, wheezy, jessie, trusty, saucy, raring, quantal, precise and lucid
5
+- name: Add Prosody Debian/Ubuntu repository
6
+  apt_repository: repo="deb http://packages.prosody.im/debian {{ ansible_distribution_release }} main"
6 7
 
7 8
 - name: Install Prosody from official repository
8 9
   apt: pkg=prosody update_cache=yes

Loading…
Cancel
Save