diff --git a/README.md b/README.md index f1bb1d8..a824937 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ koha_home_dir: /home/koha koha_install_dir: "{{ koha_home_dir }}/koha" koha_src_dir: "{{ koha_home_dir }}/Koha-{{ koha_version }}" koha_opac_hostname: koha.opendoor.fr +koha_user: koha koha_intranet_hostname: sigb.opendoor.fr koha_mariadb_server: localhost koha_mariadb_user: "kohauser" diff --git a/defaults/main.yml b/defaults/main.yml index 748a201..4cd5989 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,6 +5,7 @@ koha_version: 21.05.07 koha_home_dir: /home/koha koha_install_dir: "{{ koha_home_dir }}/koha" koha_src_dir: "{{ koha_home_dir }}/Koha-v{{ koha_version }}" +koha_user: koha koha_opac_hostname: koha.opendoor.fr koha_intranet_hostname: sigb.opendoor.fr koha_mariadb_server: localhost @@ -37,6 +38,7 @@ koha_packages: - libbusiness-issn-perl - libbytes-random-secure-perl - libcache-memcached-fast-safe-perl + - libcache-memcached-fast-perl - libcache-memcached-perl - libcgi-compile-perl - libcgi-emulate-psgi-perl @@ -182,6 +184,7 @@ koha_packages: - libyaml-libyaml-perl - libyaml-syck-perl - perl-doc + - starman - unzip - xmlstarlet - xsltproc diff --git a/tasks/apache.yml b/tasks/apache.yml index 2399999..600e4d3 100644 --- a/tasks/apache.yml +++ b/tasks/apache.yml @@ -33,6 +33,6 @@ - proxy_http - ssl - headers - - cgi + - cgid notify: reload apache diff --git a/tasks/main.yml b/tasks/main.yml index 828fe66..5bde480 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,9 +11,23 @@ # - assert: # that: result.stat.exists is false +- name: install prerequisites + tags: always + import_tasks: req.yml + - name: install memcached import_tasks: memcached.yml +- name: configure koha repo for dependencies + block: + - apt_key: + url: https://debian.koha-community.org/koha/gpg.asc + state: present + - apt_repository: + filename: koha + repo: "deb http://debian.koha-community.org/koha stable main" + state: present + - name: create koha user vars: - kohapassword: $ANSIBLE_VAULT;1.1;AES256 @@ -26,7 +40,7 @@ name: koha home: "{{ koha_home_dir }}" create_home: yes - password: "{{ kohapassword | password_hash('sha512', ansible_hostname )}}" + password: "{{ kohapassword | password_hash('sha512',123456 | random( seed=ansible_hostname )|string)}}" - name: get and extract archive block: @@ -50,7 +64,6 @@ name: "{{ koha_packages }}" - name: deploy Makefile - tags: wip template: src: "{{ item }}" dest: "{{ koha_src_dir }}" @@ -61,7 +74,6 @@ register: result - name: make && & make install - tags: wip command: "{{ item }}" loop: - make @@ -87,6 +99,11 @@ dest: /var/log/koha state: link +- name: configure log rotation + template: + src: logrotate.koha + dest: /etc/logrotate.d/koha + - name: configure apache import_tasks: apache.yml tags: apache @@ -96,14 +113,6 @@ tags: plack -- name: add fr translation - command: perl translate install fr-FR - args: - chdir: "{{ koha_install_dir }}/misc/translator/" - - - - - name: fix permissions file: path: "{{ koha_install_dir }}" @@ -123,10 +132,10 @@ - "{{ koha_install_dir }}/var/log" - "{{ koha_install_dir }}/var/run" +# cronjob +# # zebra +# traduction +# cronjob +# # zebra +# traduction -# cronjob -# # zebra -# traduction -# cronjob -# # zebra -# traduction diff --git a/tasks/req.yml b/tasks/req.yml new file mode 100644 index 0000000..ac91389 --- /dev/null +++ b/tasks/req.yml @@ -0,0 +1,7 @@ +--- +- name: install mandatory packages + package: + state: present + name: + - git + diff --git a/templates/logrotate.koha b/templates/logrotate.koha new file mode 100644 index 0000000..783a8c0 --- /dev/null +++ b/templates/logrotate.koha @@ -0,0 +1,15 @@ +# Rotate log files for all Koha instances. + +{{ koha_install_dir }}/var/log/*log { + rotate 5 + weekly + missingok + compress + delaycompress + notifempty + sharedscripts + postrotate + /bin/systemctl restart plack.service zebrasrv.service koha-sip + endscript + +} diff --git a/templates/plack.service b/templates/plack.service index 9bf27a0..b69e8e3 100644 --- a/templates/plack.service +++ b/templates/plack.service @@ -5,7 +5,7 @@ After=network.target remote-fs.target nss-lookup.target [Service] Environment="KOHA_CONF={{ koha_install_dir }}/etc/koha-conf.xml" Environment="PERL5LIB={{ koha_install_dir }}/lib" -KOHA_HOME={{ koha_install_dir }} +Environment="KOHA_HOME={{ koha_install_dir }}" Type=forking User=root ExecStart={{ koha_install_dir }}/bin/plack/koha-plack --start foobar