|
@@ -1,32 +1,27 @@
|
1
|
1
|
---
|
2
|
2
|
# Installs the ownCloud personal cloud software.
|
3
|
3
|
|
4
|
|
-- name: Install ownCloud dependencies
|
|
4
|
+- name: Install ownCloud dependencies
|
5
|
5
|
apt: pkg={{ item }} state=present
|
6
|
6
|
with_items:
|
7
|
7
|
- postgresql
|
8
|
|
- - libapache2-mod-php5
|
9
|
|
- - php-apc
|
10
|
8
|
- python-psycopg2
|
11
|
9
|
tags:
|
12
|
10
|
- dependencies
|
13
|
11
|
|
14
|
|
-- name: Set postgres password
|
15
|
|
- command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with password '{{ db_admin_password }}';"
|
|
12
|
+- name: Set postgres administrator password
|
|
13
|
+ command: sudo -u {{ db_admin_username }} psql -c "ALTER USER postgres with password '{{ db_admin_password }}';"
|
16
|
14
|
|
17
|
15
|
- name: Create database user for ownCloud
|
18
|
|
- postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_username }} password="{{ owncloud_db_password }}" state=present
|
19
|
|
-
|
20
|
|
-- name: Create database for ownCloud
|
21
|
|
- postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_database }} state=present owner={{ owncloud_db_username }}
|
|
16
|
+ postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_username }} password="{{ owncloud_db_password }}" role_attr_flags=CREATEDB state=present
|
22
|
17
|
|
23
|
18
|
- name: Ensure repository key for ownCloud is in place
|
24
|
|
- apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key state=present
|
|
19
|
+ apt_key: url=https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key state=present
|
25
|
20
|
tags:
|
26
|
21
|
- dependencies
|
27
|
22
|
|
28
|
|
-- name: Add ownCloud OpenSuSE repository
|
29
|
|
- apt_repository: repo='deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/ /'
|
|
23
|
+- name: Add ownCloud repository
|
|
24
|
+ apt_repository: repo='deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /'
|
30
|
25
|
tags:
|
31
|
26
|
- dependencies
|
32
|
27
|
|
|
@@ -42,27 +37,12 @@
|
42
|
37
|
command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
|
43
|
38
|
- file: src=/decrypted/owncloud-data dest=/var/www/owncloud/data owner=www-data group=www-data state=link
|
44
|
39
|
|
45
|
|
-- name: Enable Apache rewrite module
|
46
|
|
- command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
|
47
|
|
- notify: restart apache
|
48
|
|
-
|
49
|
|
-- name: Enable Apache headers module
|
50
|
|
- command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
|
51
|
|
- notify: restart apache
|
52
|
|
-
|
53
|
|
-- name: Enable Apache expires module
|
54
|
|
- command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
|
|
40
|
+- name: Remove conf-enabled/owncloud symlink
|
|
41
|
+ file: path=/etc/apache2/conf-enabled/owncloud.conf state=absent
|
55
|
42
|
notify: restart apache
|
56
|
43
|
|
57
|
|
-- name: Rename existing Apache owncloud virtualhost
|
58
|
|
- command: mv /etc/apache2/sites-available/owncloud /etc/apache2/sites-available/owncloud.conf removes=/etc/apache2/sites-available/owncloud
|
59
|
|
-
|
60
|
|
-- name: Remove old sites-enabled/owncloud symlink (new one will be created by a2ensite)
|
61
|
|
- file: path=/etc/apache2/sites-enabled/owncloud state=absent
|
62
|
|
-
|
63
|
44
|
- name: Configure the Apache HTTP server for ownCloud
|
64
|
|
- template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root owner=root
|
65
|
|
-
|
|
45
|
+ template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root
|
66
|
46
|
- name: Enable the owncloud site
|
67
|
47
|
command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
|
68
|
48
|
notify: restart apache
|