main.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ---
  2. ## Based on
  3. ## https://wiki.koha-community.org/wiki/Debian
  4. - name: Add an Apt signing key, will not download if present
  5. become: yes
  6. apt_key:
  7. url: https://debian.koha-community.org/koha/gpg.asc
  8. state: present
  9. keyring: /usr/share/keyrings/koha-community-archive-keyring.gpg
  10. - name: Add Koha package repository
  11. become: yes
  12. apt_repository:
  13. filename: koha.list
  14. repo: "deb [signed-by=/usr/share/keyrings/koha-community-archive-keyring.gpg] http://debian.koha-community.org/koha stable main"
  15. update_cache: yes
  16. - name: Install koha and mariadb
  17. become: yes
  18. apt:
  19. pkg:
  20. - koha-common
  21. - mariadb-server
  22. - name: Configure the defaults
  23. become: yes
  24. template:
  25. src: koha-sites.conf.j2
  26. dest: /etc/koha/koha-sites.conf
  27. - name: Enable the Apache2 module rewrite
  28. become: yes
  29. apache2_module:
  30. state: present
  31. name: rewrite
  32. - name: Enable the Apache2 module cgi
  33. become: yes
  34. apache2_module:
  35. state: present
  36. name: cgi
  37. - name: Make sure apache2 is restarted
  38. become: yes
  39. systemd:
  40. state: restarted
  41. name: apache2
  42. - name: Create koha instance
  43. become: yes
  44. command:
  45. cmd: koha-create --create-db "{{library_name}}"
  46. - name: Enable the Apache2 module cgi
  47. become: yes
  48. apache2_module:
  49. state: present
  50. name: headers
  51. - name: Enable the Apache2 module cgi
  52. become: yes
  53. apache2_module:
  54. state: present
  55. name: proxy_http
  56. - name: Enable plack
  57. become: yes
  58. command:
  59. cmd: koha-plack --enable "{{library_name}}"
  60. - name: Start plack
  61. become: yes
  62. command:
  63. cmd: koha-plack --start "{{library_name}}"
  64. - name: Make sure apache2 is restarted
  65. become: yes
  66. systemd:
  67. state: restarted
  68. name: apache2