浏览代码

hibiscus-server

master
当前提交
4903e1cc27
共有 7 个文件被更改,包括 155 次插入0 次删除
  1. +9
    -0
      defaults/main.yaml
  2. +9
    -0
      files/systemd/hibiscus-server.service
  3. +10
    -0
      handlers/main.yaml
  4. +116
    -0
      tasks/main.yaml
  5. +4
    -0
      templates/de.willuhn.jameica.hbci.rmi.HBCIDBService.properties.j2
  6. +1
    -0
      templates/env.j2
  7. +6
    -0
      vars/main.yaml

+ 9
- 0
defaults/main.yaml 查看文件

@@ -0,0 +1,9 @@
---

hibiscus_server_version: 2.8.23

hibiscus_server_master_password: "{{ secrets.hibiscus_server_master_password }}"

hibiscus_server_db_name: hibiscus
hibiscus_server_db_user: hibiscus
hibiscus_server_db_pass: "{{ secrets.hibiscus_server_db_pass }}"

+ 9
- 0
files/systemd/hibiscus-server.service 查看文件

@@ -0,0 +1,9 @@

[Service]
EnvironmentFile=/etc/hibiscus-server/env
ExecStart=/opt/hibiscus-server/jameicaserver.sh -p $HIBISCUS_SERVER_MASTER_PASSWORD
User=hibiscus-server
Group=hibiscus-server

[Install]
WantedBy=multi-user.target

+ 10
- 0
handlers/main.yaml 查看文件

@@ -0,0 +1,10 @@
---

- name: systemd daemon reload
systemd:
daemon_reload: yes

- name: restart hibiscus-server service
systemd:
state: restarted
name: hibiscus-server.service

+ 116
- 0
tasks/main.yaml 查看文件

@@ -0,0 +1,116 @@
---

- 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

+ 4
- 0
templates/de.willuhn.jameica.hbci.rmi.HBCIDBService.properties.j2 查看文件

@@ -0,0 +1,4 @@
database.driver=de.willuhn.jameica.hbci.server.DBSupportMySqlImpl
database.driver.mysql.jdbcurl=jdbc\:mysql\://localhost\:3306/{{hibiscus_server_db_name}}?useUnicode\=Yes&characterEncoding\=UTF8
database.driver.mysql.username={{hibiscus_server_db_user}}
database.driver.mysql.password={{hibiscus_server_db_pass}}

+ 1
- 0
templates/env.j2 查看文件

@@ -0,0 +1 @@
HIBISCUS_SERVER_MASTER_PASSWORD={{hibiscus_server_master_password}}

+ 6
- 0
vars/main.yaml 查看文件

@@ -0,0 +1,6 @@
---
hibiscus_server_secrets_definitions:
hibiscus_server_db_pass:
store: local_facts
hibiscus_server_master_password:
store: local_facts

正在加载...
取消
保存