|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- ---
-
- - import_role:
- name: secrets
- vars:
- secrets_definitions: "{{ hibiscus_server_secrets_definitions }}"
-
- - import_role:
- name: adoptopenjdk
-
- - import_role:
- name: mysql_server
-
- - name: apt packages
- apt:
- pkg:
- - adoptopenjdk-8-hotspot
-
- - name: hibiscus-server src directory
- file:
- path: /usr/local/src/hibiscus-server
- state: directory
-
- - name: get hibiscus-server archive checksum
- uri:
- url: https://www.willuhn.de/products/hibiscus-server/releases/hibiscus-server-{{hibiscus_server_version}}.zip.SHA
- return_content: true
- register: hibiscus_server_archive_checksum_uri
-
- - name: get hibiscus-server archive
- get_url:
- url: https://www.willuhn.de/products/hibiscus-server/releases/hibiscus-server-{{hibiscus_server_version}}.zip
- dest: /usr/local/src/hibiscus-server/hibiscus-server-{{hibiscus_server_version}}.zip
- checksum: sha1:{{hibiscus_server_archive_checksum_uri.content.split(" ")[0]}}
-
- - name: extract hibiscus-server archive
- unarchive:
- src: /usr/local/src/hibiscus-server/hibiscus-server-{{hibiscus_server_version}}.zip
- dest: /opt
- remote_src: yes
- exclude:
- - hibiscus-server/cfg/de.willuhn.jameica.hbci.rmi.HBCIDBService.properties
-
-
- - name: hibiscus-server user
- group:
- name: hibiscus-server
-
- - name: hibiscus-server user
- user:
- name: hibiscus-server
- group: hibiscus-server
- home: /var/lib/hibiscus-server
-
- - name: hibiscus-server home directory
- file:
- path: /var/lib/hibiscus-server
- owner: hibiscus-server
- group: hibiscus-server
- mode: 0700
- state: directory
-
- - name: hibiscus-server systemd service unit
- copy:
- src: systemd/hibiscus-server.service
- dest: /etc/systemd/system/hibiscus-server.service
- notify: systemd daemon reload
-
- - name: hibiscus-server etc directory
- file:
- path: /etc/hibiscus-server
- state: directory
-
- - name: hibiscus-server env
- template:
- src: env.j2
- dest: /etc/hibiscus-server/env
- mode: 0600
-
- - name: mysql database
- mysql_db:
- name: "{{hibiscus_server_db_name}}"
- state: present
- encoding: utf8
- collation: utf8_general_ci
- login_unix_socket: /run/mysqld/mysqld.sock
- register: hibiscus_server_mysql_database
-
- - name: create hibiscus-server mysql database layout
- shell:
- cat /opt/hibiscus-server/plugins/hibiscus/sql/mysql-create.sql
- | mysql "{{hibiscus_server_db_name}}"
- when: "{{ hibiscus_server_mysql_database.changed }}"
-
- - name: mysql user
- mysql_user:
- name: "{{hibiscus_server_db_user}}"
- password: "{{hibiscus_server_db_pass}}"
- priv: "{{hibiscus_server_db_name}}.*:ALL,GRANT"
- host: localhost
- state: present
- login_unix_socket: /run/mysqld/mysqld.sock
-
- - name: hibiscus-server database config symlink
- file:
- dest: /opt/hibiscus-server/cfg/de.willuhn.jameica.hbci.rmi.HBCIDBService.properties
- src: /etc/hibiscus-server/de.willuhn.jameica.hbci.rmi.HBCIDBService.properties
- state: link
- force: true
-
- - name: hibiscus-server database config
- template:
- src: de.willuhn.jameica.hbci.rmi.HBCIDBService.properties.j2
- dest: /etc/hibiscus-server/de.willuhn.jameica.hbci.rmi.HBCIDBService.properties
- mode: 0640
- group: hibiscus-server
|