Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

wallabag.yml 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 (PHP5 variant)
  13. apt: pkg={{ item }} state=present
  14. with_items:
  15. - php5
  16. - php5-curl
  17. - php5-mcrypt
  18. - php5-pgsql
  19. - php5-tidy
  20. when: (ansible_distribution_release != "xenial" and ansible_distribution_release != "bionic" and ansible_distribution_release != "stretch")
  21. tags:
  22. - dependencies
  23. - name: Install wallabag dependencies
  24. apt: pkg={{ item }} state=present
  25. with_items:
  26. - php
  27. - php-curl
  28. - php-mcrypt
  29. - php-pgsql
  30. - php-tidy
  31. when: (ansible_distribution_release == "xenial" or ansible_distribution_release == "bionic" or ansible_distribution_release == "stretch")
  32. tags:
  33. - dependencies
  34. - name: Create database user for wallabag
  35. postgresql_user: login_host=localhost
  36. login_user={{ db_admin_username }}
  37. login_password="{{ db_admin_password }}"
  38. name={{ wallabag_db_username }}
  39. password="{{ wallabag_db_password }}"
  40. state=present
  41. - name: Create database for wallabag
  42. postgresql_db: login_host=localhost
  43. login_user={{ db_admin_username }}
  44. login_password="{{ db_admin_password }}"
  45. name={{ wallabag_db_database }}
  46. state=present
  47. owner={{ wallabag_db_username }}
  48. notify: import wallabag sql
  49. - name: Get Composer installer
  50. get_url: url=https://getcomposer.org/installer
  51. dest=/tmp/composer-installer
  52. - name: Install Composer
  53. command: php /tmp/composer-installer
  54. chdir=/root
  55. creates=/root/composer.phar
  56. - name: Initialize composer
  57. command: php /root/composer.phar install
  58. chdir=/var/www/wallabag
  59. creates=/var/www/wallabag/vendor/autoload.php
  60. - name: Set wallabag ownership
  61. file: owner=root
  62. group=www-data
  63. path=/var/www/wallabag
  64. recurse=yes
  65. state=directory
  66. # the httpd only needs write access to the wallabag assets, cache and db directories
  67. - name: Set wallabag assets, cache and db permissions
  68. file: path=/var/www/wallabag/{{ item }}
  69. mode=0775
  70. state=directory
  71. with_items:
  72. - assets
  73. - cache
  74. - db
  75. - name: Create the configuration file
  76. template: src=var_www_wallabag_inc_poche_config.inc.php.j2
  77. dest=/var/www/wallabag/inc/poche/config.inc.php
  78. owner=root
  79. group=www-data
  80. - name: Rename existing Apache wallabag virtualhost
  81. command: mv /etc/apache2/sites-available/wallabag /etc/apache2/sites-available/wallabag.conf removes=/etc/apache2/sites-available/wallabag
  82. - name: Remove old sites-enabled/wallabag symlink (new one will be created by a2ensite)
  83. file: path=/etc/apache2/sites-enabled/wallabag state=absent
  84. - name: Configure the Apache HTTP server for wallabag
  85. template: src=etc_apache2_sites-available_wallabag.j2
  86. dest=/etc/apache2/sites-available/wallabag.conf
  87. owner=root
  88. group=root
  89. - name: Enable the wallabag site
  90. command: a2ensite wallabag.conf
  91. creates=/etc/apache2/sites-enabled/wallabag.conf
  92. notify: restart apache