No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wallabag.yml 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. - name: Determine whether wallabag is configured
  2. stat: path=/var/www/wallabag/inc/poche/config.inc.php
  3. register: wallabag_config
  4. - name: Clone wallabag
  5. git: repo=https://github.com/wallabag/wallabag.git
  6. dest=/var/www/wallabag
  7. version={{ wallabag_version }}
  8. accept_hostkey=yes
  9. - name: Remove wallabag 'install' directory if its configuration file is there
  10. file: name=/var/www/wallabag/install state=absent
  11. when: wallabag_config.stat.exists == True
  12. - name: Install wallabag dependencies
  13. apt: pkg={{ item }} state=present
  14. with_items:
  15. - php5
  16. - php5-curl
  17. - php5-mcrypt
  18. - php5-pgsql
  19. - php5-tidy
  20. tags:
  21. - deps
  22. - name: Create database user for wallabag
  23. postgresql_user: login_host=localhost
  24. login_user={{ db_admin_username }}
  25. login_password="{{ db_admin_password }}"
  26. name={{ wallabag_db_username }}
  27. password="{{ wallabag_db_password }}"
  28. state=present
  29. - name: Create database for wallabag
  30. postgresql_db: login_host=localhost
  31. login_user={{ db_admin_username }}
  32. login_password="{{ db_admin_password }}"
  33. name={{ wallabag_db_database }}
  34. state=present
  35. owner={{ wallabag_db_username }}
  36. notify: import wallabag sql
  37. - name: Build Composer
  38. shell: curl -sS https://getcomposer.org/installer | php
  39. chdir=/root
  40. creates=/root/composer.phar
  41. - name: Initialize composer
  42. command: php /root/composer.phar install
  43. chdir=/var/www/wallabag
  44. creates=/var/www/wallabag/vendor/autoload.php
  45. - name: Set wallabag ownership
  46. file: owner=root
  47. group=www-data
  48. path=/var/www/wallabag
  49. recurse=yes
  50. state=directory
  51. # the httpd only needs write access to the wallabag assets, cache and db directories
  52. - name: Set wallabag assets, cache and db permissions
  53. file: path=/var/www/wallabag/{{ item }}
  54. mode=0775
  55. state=directory
  56. with_items:
  57. - assets
  58. - cache
  59. - db
  60. - name: Create the configuration file
  61. template: src=var_www_wallabag_inc_poche_config.inc.php.j2
  62. dest=/var/www/wallabag/inc/poche/config.inc.php
  63. owner=root
  64. group=www-data
  65. - name: Rename existing Apache wallabag virtualhost
  66. command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
  67. - 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
  69. - name: Configure the Apache HTTP server for wallabag
  70. template: src=etc_apache2_sites-available_wallabag.j2
  71. dest=/etc/apache2/sites-available/wallabag.conf
  72. owner=root
  73. group=root
  74. - name: Enable the wallabag site
  75. command: a2ensite wallabag.conf
  76. creates=/etc/apache2/sites-enabled/wallabag.conf
  77. notify: restart apache