From 874b45e9f6133e6b209ceafd1920de2e879b14ee Mon Sep 17 00:00:00 2001 From: Lex Rivera Date: Wed, 12 Sep 2018 18:33:37 +0300 Subject: add support for ts3db_mariadb plugin --- tasks/main.yml | 11 +++++++++++ templates/ts3db_mariadb.ini.j2 | 6 ++++++ templates/ts3server.ini.j2 | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 templates/ts3db_mariadb.ini.j2 diff --git a/tasks/main.yml b/tasks/main.yml index f524f4c..58a9cc3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -47,6 +47,17 @@ notify: - Restart teamspeak server +- name: "Configuration : Create TeamSpeak 3 database server configuration file" + template: + src: ts3db_mariadb.ini.j2 + dest: "{{ teamspeak.home }}/ts3db_mariadb.ini" + mode: 0644 + owner: "{{ teamspeak.user }}" + group: "{{ teamspeak.user }}" + notify: + - Restart teamspeak server + when: teamspeak_db.plugin == 'ts3db_mariadb' + - name: "Ensure license directory exists" file: path: "{{ teamspeak_licensepath }}" diff --git a/templates/ts3db_mariadb.ini.j2 b/templates/ts3db_mariadb.ini.j2 new file mode 100644 index 0000000..4755b65 --- /dev/null +++ b/templates/ts3db_mariadb.ini.j2 @@ -0,0 +1,6 @@ +[config] +host={{ teamspeak_db.host }} +port={{ teamspeak_db.port }} +username={{ teamspeak_db.username }} +password={{ teamspeak_db.password }} +database={{ teamspeak_db.database }} diff --git a/templates/ts3server.ini.j2 b/templates/ts3server.ini.j2 index 0f434fa..2d5dcd8 100644 --- a/templates/ts3server.ini.j2 +++ b/templates/ts3server.ini.j2 @@ -13,3 +13,11 @@ licensepath={{ teamspeak_licensepath }}/ {% if teamspeak_machine_id is not none %} machine_id={{ teamspeak_machine_id }} {% endif %} + +{% if teamspeak_db.plugin == 'ts3db_mariadb' %} +dbplugin={{ teamspeak_db.plugin }} +dbpluginparameter=ts3db_mariadb.ini +dbsqlpath=sql/ +dbsqlcreatepath=create_mysql/ +dbconnections=10 +{% endif %} -- cgit v1.2.3-70-g09d2