Ei kuvausta
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 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. - name: Create database user for wallabag
  21. postgresql_user: login_host=localhost
  22. login_user={{ db_admin_username }}
  23. login_password="{{ db_admin_password }}"
  24. name={{ wallabag_db_username }}
  25. password="{{ wallabag_db_password }}"
  26. state=present
  27. - name: Create database for wallabag
  28. postgresql_db: login_host=localhost
  29. login_user={{ db_admin_username }}
  30. login_password="{{ db_admin_password }}"
  31. name={{ wallabag_db_database }}
  32. state=present
  33. owner={{ wallabag_db_username }}
  34. notify: import wallabag sql
  35. - name: Build Composer
  36. shell: curl -sS https://getcomposer.org/installer | php
  37. chdir=/root
  38. creates=/root/composer.phar
  39. - name: Initialize composer
  40. command: php /root/composer.phar install
  41. chdir=/var/www/wallabag
  42. creates=/var/www/wallabag/vendor/autoload.php
  43. - name: Set wallabag ownership
  44. file: owner=root
  45. group=www-data
  46. path=/var/www/wallabag
  47. recurse=yes
  48. state=directory
  49. # the httpd only needs write access to the wallabag assets, cache and db directories
  50. - name: Set wallabag assets, cache and db permissions
  51. file: path=/var/www/wallabag/{{ item }}
  52. mode=0775
  53. state=directory
  54. with_items:
  55. - assets
  56. - cache
  57. - db
  58. - name: Create the configuration file
  59. template: src=var_www_wallabag_inc_poche_config.inc.php.j2
  60. dest=/var/www/wallabag/inc/poche/config.inc.php
  61. owner=root
  62. group=www-data
  63. - name: Rename existing Apache wallabag virtualhost
  64. command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
  65. - name: Remove old sites-enabled/wallabag symlink (new one will be created by a2ensite)
  66. command: rm /etc/apache2/sites-enabled/wallabag removes=/etc/apache2/sites-enabled/wallabag
  67. - name: Configure the Apache HTTP server for wallabag
  68. template: src=etc_apache2_sites-available_wallabag.j2
  69. dest=/etc/apache2/sites-available/wallabag.conf
  70. owner=root
  71. group=root
  72. - name: Enable the wallabag site
  73. command: a2ensite wallabag.conf
  74. creates=/etc/apache2/sites-enabled/wallabag.conf
  75. notify: restart apache