From 63c532aef101c32cfed7d48d42dd78e92c1ab391 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 23 Apr 2019 18:34:18 +0200 Subject: [PATCH] database modif gitea --- defaults/main.yml | 4 +++- tasks/main.yml | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index fc55b45..87b092a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -18,4 +18,6 @@ ttrss_enable_gzip: true # syslog - logs to system log # sql - logs to database, can be seen in Preferences -> System # '' - uses PHP logging, usually the http server error log -ttrss_log_destination: "syslog" \ No newline at end of file +ttrss_log_destination: "syslog" +# +ttrss_SQl_target_file: /usr/share/webapps/tt-rss/schema/ttrss_schema_mysql.sql \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 88719c3..d2a664a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,6 +13,15 @@ collation: utf8_general_ci encoding: utf8 state: present + register: ttrss_database_creation + +- name: import DATA in database in case of creation + become: yes + mysql_db: + name: "{{ ttrss_db_name }}" + state: import + target: "{{ttrss_SQl_target_file}}" + when: ttrss_database_creation.changed == true and ttrss_SQl_target_file is defined - name: "Ensure db user is present" become: yes