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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. - dependencies
  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: Get Composer installer
  38. get_url: url=https://getcomposer.org/installer
  39. dest=/tmp/composer-installer
  40. - name: Install Composer
  41. command: php /tmp/composer-installer
  42. chdir=/root
  43. creates=/root/composer.phar
  44. - name: Initialize composer
  45. command: php /root/composer.phar install
  46. chdir=/var/www/wallabag
  47. creates=/var/www/wallabag/vendor/autoload.php
  48. - name: Set wallabag ownership
  49. file: owner=root
  50. group=www-data
  51. path=/var/www/wallabag
  52. recurse=yes
  53. state=directory
  54. # the httpd only needs write access to the wallabag assets, cache and db directories
  55. - name: Set wallabag assets, cache and db permissions
  56. file: path=/var/www/wallabag/{{ item }}
  57. mode=0775
  58. state=directory
  59. with_items:
  60. - assets
  61. - cache
  62. - db
  63. - name: Create the configuration file
  64. template: src=var_www_wallabag_inc_poche_config.inc.php.j2
  65. dest=/var/www/wallabag/inc/poche/config.inc.php
  66. owner=root
  67. group=www-data
  68. - name: Rename existing Apache wallabag virtualhost
  69. command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
  70. - name: Remove old sites-enabled/wallabag symlink (new one will be created by a2ensite)
  71. file: path=/etc/apache2/sites-enabled/wallabag state=absent
  72. - name: Configure the Apache HTTP server for wallabag
  73. template: src=etc_apache2_sites-available_wallabag.j2
  74. dest=/etc/apache2/sites-available/wallabag.conf
  75. owner=root
  76. group=root
  77. - name: Enable the wallabag site
  78. command: a2ensite wallabag.conf
  79. creates=/etc/apache2/sites-enabled/wallabag.conf
  80. notify: restart apache