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.

selfoss.yml 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. - name: Clone Selfoss
  2. git: repo=https://github.com/SSilence/selfoss.git
  3. dest=/var/www/selfoss
  4. accept_hostkey=yes
  5. version={{ selfoss_version }}
  6. - name: Set selfoss ownership
  7. action: file owner=root group=www-data path=/var/www/selfoss recurse=yes state=directory
  8. # only data/cache, data/favicons, data/logs, data/thumbnails, data/sqlite public/ should be writeable by httpd
  9. - name: Set selfoss permission
  10. action: file path=/var/www/selfoss/{{ item }} mode=0775
  11. with_items:
  12. - data/cache
  13. - data/favicons
  14. - data/logs
  15. - data/thumbnails
  16. - data/sqlite
  17. - public
  18. - name: Install selfoss dependencies (PHP5 variant)
  19. apt: pkg={{ item }} state=present
  20. with_items:
  21. - php5
  22. - php5-pgsql
  23. - php5-gd
  24. when: (ansible_distribution_release != "xenial" and ansible_distribution_release != "bionic" and ansible_distribution_release != "stretch")
  25. tags:
  26. - dependencies
  27. - name: Install selfoss dependencies
  28. apt: pkg={{ item }} state=present
  29. with_items:
  30. - php
  31. - php-pgsql
  32. - php-gd
  33. when: (ansible_distribution_release == "xenial" or ansible_distribution_release == "bionic" or ansible_distribution_release == "stretch")
  34. tags:
  35. - dependencies
  36. - name: Create database user for selfoss
  37. postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ selfoss_db_username }} password="{{ selfoss_db_password }}" state=present
  38. - name: Create database for selfoss
  39. postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ selfoss_db_database }} state=present owner={{ selfoss_db_username }}
  40. - name: Install selfoss config.ini
  41. template: src=var_www_selfoss_config.ini.j2 dest=/var/www/selfoss/config.ini group=www-data owner=root mode=0640
  42. - name: Enable Apache rewrite module
  43. command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
  44. notify: restart apache
  45. - name: Enable Apache headers module
  46. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  47. notify: restart apache
  48. - name: Enable Apache expires module
  49. command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
  50. notify: restart apache
  51. - name: Rename existing Apache blog virtualhost
  52. command: mv /etc/apache2/sites-available/selfoss /etc/apache2/sites-available/selfoss.conf removes=/etc/apache2/sites-available/selfoss
  53. - name: Remove old sites-enabled/selfoss symlink (new one will be created by a2ensite)
  54. file: path=/etc/apache2/sites-enabled/selfoss state=absent
  55. - name: Configure the Apache HTTP server for selfoss
  56. template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss.conf group=root owner=root
  57. - name: Enable the selfoss site
  58. command: a2ensite selfoss.conf creates=/etc/apache2/sites-enabled/selfoss.conf
  59. notify: restart apache
  60. - name: Install selfoss cronjob
  61. cron: name="selfoss" user="www-data" minute="*/5" job="curl --silent --show-error -k 'https://{{ selfoss_domain }}/update' > /dev/null"
  62. - name: Configure selfoss logrotate
  63. copy: src=etc_logrotate_selfoss dest=/etc/logrotate.d/selfoss owner=root group=root mode=0644