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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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
  19. apt: pkg={{ item }} state=present
  20. with_items:
  21. - php5
  22. - php5-pgsql
  23. - php5-gd
  24. tags:
  25. - dependencies
  26. - name: Create database user for selfoss
  27. 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
  28. - name: Create database for selfoss
  29. 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 }}
  30. - name: Install selfoss config.ini
  31. template: src=var_www_selfoss_config.ini.j2 dest=/var/www/selfoss/config.ini group=www-data owner=root mode=0640
  32. - name: Enable Apache rewrite module
  33. command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
  34. notify: restart apache
  35. - name: Enable Apache headers module
  36. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  37. notify: restart apache
  38. - name: Enable Apache expires module
  39. command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
  40. notify: restart apache
  41. - name: Rename existing Apache blog virtualhost
  42. command: mv /etc/apache2/sites-available/selfoss /etc/apache2/sites-available/selfoss.conf removes=/etc/apache2/sites-available/selfoss
  43. - name: Remove old sites-enabled/selfoss symlink (new one will be created by a2ensite)
  44. file: path=/etc/apache2/sites-enabled/selfoss state=absent
  45. - name: Configure the Apache HTTP server for selfoss
  46. template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss.conf group=root owner=root
  47. - name: Enable the selfoss site
  48. command: a2ensite selfoss.conf creates=/etc/apache2/sites-enabled/selfoss.conf
  49. notify: restart apache
  50. - name: Install selfoss cronjob
  51. cron: name="selfoss" user="www-data" minute="*/5" job="curl --silent --show-error -k 'https://{{ selfoss_domain }}/update' > /dev/null"
  52. - name: Configure selfoss logrotate
  53. copy: src=etc_logrotate_selfoss dest=/etc/logrotate.d/selfoss owner=root group=root mode=0644