|
- ---
-
- - 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
|