|
@@ -1,108 +0,0 @@
|
1
|
|
-- name: Determine whether wallabag is configured
|
2
|
|
- stat: path=/var/www/wallabag/inc/poche/config.inc.php
|
3
|
|
- register: wallabag_config
|
4
|
|
-
|
5
|
|
-- name: Clone wallabag
|
6
|
|
- git: repo=https://github.com/wallabag/wallabag.git
|
7
|
|
- dest=/var/www/wallabag
|
8
|
|
- version={{ wallabag_version }}
|
9
|
|
- accept_hostkey=yes
|
10
|
|
-
|
11
|
|
-- name: Remove wallabag 'install' directory if its configuration file is there
|
12
|
|
- file: name=/var/www/wallabag/install state=absent
|
13
|
|
- when: wallabag_config.stat.exists == True
|
14
|
|
-
|
15
|
|
-- name: Install wallabag dependencies (PHP5 variant)
|
16
|
|
- apt: pkg={{ item }} state=present
|
17
|
|
- with_items:
|
18
|
|
- - php5
|
19
|
|
- - php5-curl
|
20
|
|
- - php5-mcrypt
|
21
|
|
- - php5-pgsql
|
22
|
|
- - php5-tidy
|
23
|
|
- when: (ansible_distribution_release != "xenial" and ansible_distribution_release != "bionic" and ansible_distribution_release != "stretch")
|
24
|
|
- tags:
|
25
|
|
- - dependencies
|
26
|
|
-
|
27
|
|
-- name: Install wallabag dependencies
|
28
|
|
- apt: pkg={{ item }} state=present
|
29
|
|
- with_items:
|
30
|
|
- - php
|
31
|
|
- - php-curl
|
32
|
|
- - php-mcrypt
|
33
|
|
- - php-pgsql
|
34
|
|
- - php-tidy
|
35
|
|
- when: (ansible_distribution_release == "xenial" or ansible_distribution_release == "bionic" or ansible_distribution_release == "stretch")
|
36
|
|
- tags:
|
37
|
|
- - dependencies
|
38
|
|
-
|
39
|
|
-- name: Create database user for wallabag
|
40
|
|
- postgresql_user: login_host=localhost
|
41
|
|
- login_user={{ db_admin_username }}
|
42
|
|
- login_password="{{ db_admin_password }}"
|
43
|
|
- name={{ wallabag_db_username }}
|
44
|
|
- password="{{ wallabag_db_password }}"
|
45
|
|
- state=present
|
46
|
|
-
|
47
|
|
-- name: Create database for wallabag
|
48
|
|
- postgresql_db: login_host=localhost
|
49
|
|
- login_user={{ db_admin_username }}
|
50
|
|
- login_password="{{ db_admin_password }}"
|
51
|
|
- name={{ wallabag_db_database }}
|
52
|
|
- state=present
|
53
|
|
- owner={{ wallabag_db_username }}
|
54
|
|
- notify: import wallabag sql
|
55
|
|
-
|
56
|
|
-- name: Get Composer installer
|
57
|
|
- get_url: url=https://getcomposer.org/installer
|
58
|
|
- dest=/tmp/composer-installer
|
59
|
|
-
|
60
|
|
-- name: Install Composer
|
61
|
|
- command: php /tmp/composer-installer
|
62
|
|
- chdir=/root
|
63
|
|
- creates=/root/composer.phar
|
64
|
|
-
|
65
|
|
-- name: Initialize composer
|
66
|
|
- command: php /root/composer.phar install
|
67
|
|
- chdir=/var/www/wallabag
|
68
|
|
- creates=/var/www/wallabag/vendor/autoload.php
|
69
|
|
-
|
70
|
|
-- name: Set wallabag ownership
|
71
|
|
- file: owner=root
|
72
|
|
- group=www-data
|
73
|
|
- path=/var/www/wallabag
|
74
|
|
- recurse=yes
|
75
|
|
- state=directory
|
76
|
|
-
|
77
|
|
-# the httpd only needs write access to the wallabag assets, cache and db directories
|
78
|
|
-- name: Set wallabag assets, cache and db permissions
|
79
|
|
- file: path=/var/www/wallabag/{{ item }}
|
80
|
|
- mode=0775
|
81
|
|
- state=directory
|
82
|
|
- with_items:
|
83
|
|
- - assets
|
84
|
|
- - cache
|
85
|
|
- - db
|
86
|
|
-
|
87
|
|
-- name: Create the configuration file
|
88
|
|
- template: src=var_www_wallabag_inc_poche_config.inc.php.j2
|
89
|
|
- dest=/var/www/wallabag/inc/poche/config.inc.php
|
90
|
|
- owner=root
|
91
|
|
- group=www-data
|
92
|
|
-
|
93
|
|
-- name: Rename existing Apache wallabag virtualhost
|
94
|
|
- command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
|
95
|
|
-
|
96
|
|
-- name: Remove old sites-enabled/wallabag symlink (new one will be created by a2ensite)
|
97
|
|
- file: path=/etc/apache2/sites-enabled/wallabag state=absent
|
98
|
|
-
|
99
|
|
-- name: Configure the Apache HTTP server for wallabag
|
100
|
|
- template: src=etc_apache2_sites-available_wallabag.j2
|
101
|
|
- dest=/etc/apache2/sites-available/wallabag.conf
|
102
|
|
- owner=root
|
103
|
|
- group=root
|
104
|
|
-
|
105
|
|
-- name: Enable the wallabag site
|
106
|
|
- command: a2ensite wallabag.conf
|
107
|
|
- creates=/etc/apache2/sites-enabled/wallabag.conf
|
108
|
|
- notify: restart apache
|