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.

65 lines
1.3 KiB

  1. ---
  2. - name: apt-get install git virtualenv python-pip and python-setuptools python-backports.ssl-match-hostname
  3. apt:
  4. name: [ git, virtualenv, python-pip, python-setuptools, python-backports.ssl-match-hostname ]
  5. state: present
  6. - name: chown debian /srv
  7. file:
  8. path: /srv
  9. owner: debian
  10. - name: "git clone {{ website_repository }}"
  11. git:
  12. repo: "{{ website_repository }}"
  13. force: yes
  14. dest: /srv/website
  15. become: False
  16. - name: apt-get install rsync
  17. apt:
  18. name: rsync
  19. state: present
  20. - name: apt-get install hugo
  21. apt:
  22. name: hugo
  23. state: present
  24. - name: /usr/share/nginx/html is owned by debian
  25. file:
  26. path: /usr/share/nginx/html
  27. state: directory
  28. mode: 0755
  29. owner: debian
  30. - name: Copy update-website.sh
  31. template:
  32. src: update-website.sh.j2
  33. dest: /srv/update-website.sh
  34. owner: debian
  35. mode: "0755"
  36. - name: Copy crontab
  37. template:
  38. src: crontab
  39. dest: /srv/crontab
  40. owner: debian
  41. mode: "0600"
  42. register: crontab
  43. - name: update-website.sh log file
  44. file:
  45. path: /var/log/update-website.log
  46. state: touch
  47. owner: debian
  48. - name: install /etc/logrotate.d/website-logrotate
  49. copy:
  50. src: website-logrotate
  51. dest: /etc/logrotate.d/website-logrotate
  52. - name: Activate crontab
  53. shell: crontab /srv/crontab
  54. when: crontab is changed
  55. become: False