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 2.7KB

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