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.6KB

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