123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- - name: Determine whether wallabag is configured
- stat: path=/var/www/wallabag/inc/poche/config.inc.php
- register: wallabag_config
-
- - name: Clone wallabag
- git: repo=https://github.com/wallabag/wallabag.git
- dest=/var/www/wallabag
- version={{ wallabag_version }}
-
- - name: Remove wallabag 'install' directory if its configuration file is there
- file: name=/var/www/wallabag/install state=absent
- when: wallabag_config.stat.exists == True
-
- - name: Install wallabag dependencies
- apt: pkg={{ item }} state=present
- with_items:
- - php5
- - php5-curl
- - php5-mcrypt
- - php5-pgsql
- - php5-tidy
-
- - name: Create database user for wallabag
- postgresql_user: login_host=localhost
- login_user={{ db_admin_username }}
- login_password="{{ db_admin_password }}"
- name={{ wallabag_db_username }}
- password="{{ wallabag_db_password }}"
- state=present
-
- - name: Create database for wallabag
- postgresql_db: login_host=localhost
- login_user={{ db_admin_username }}
- login_password="{{ db_admin_password }}"
- name={{ wallabag_db_database }}
- state=present
- owner={{ wallabag_db_username }}
- notify: import wallabag sql
-
- - name: Build Composer
- shell: curl -sS https://getcomposer.org/installer | php
- chdir=/root
- creates=/root/composer.phar
-
- - name: Initialize composer
- command: php /root/composer.phar install
- chdir=/var/www/wallabag
- creates=/var/www/wallabag/vendor/autoload.php
-
- - name: Set wallabag permissions
- file: owner=www-data
- group=www-data
- path=/var/www/wallabag
- recurse=yes
- state=directory
-
- - name: Create the configuration file
- template: src=var_www_wallabag_inc_poche_config.inc.php.j2
- dest=/var/www/wallabag/inc/poche/config.inc.php
- owner=www-data
- group=www-data
-
- - name: Rename existing Apache wallabag virtualhost
- command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
-
- - name: Remove old sites-enabled/wallabag symlink (new one will be created by a2ensite)
- command: rm /etc/apache2/sites-enabled/wallabag removes=/etc/apache2/sites-enabled/wallabag
-
- - name: Configure the Apache HTTP server for wallabag
- template: src=etc_apache2_sites-available_wallabag.j2
- dest=/etc/apache2/sites-available/wallabag.conf
- owner=root
- group=root
-
- - name: Enable the wallabag site
- command: a2ensite wallabag.conf
- creates=/etc/apache2/sites-enabled/wallabag.conf
- notify: restart apache
|