diff --git a/defaults/main.yml b/defaults/main.yml index 5d8ba4b..4e18a2b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,4 +16,5 @@ supysonic_db_user: supysonic supysonic_db_password: supysonic # Database name supysonic_db_name: supysonic -supysonic_log_level: INFO \ No newline at end of file +supysonic_log_level: INFO +gitea_SQl_target_file: [] \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 1bf070b..7ea901a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,5 @@ --- -# tasks file for chainetv +# tasks file for supysonic - name: "Ensure database is present" become: yes @@ -8,8 +8,15 @@ collation: utf8_general_ci encoding: utf8 state: present - register: ttrss_database_creation + register: supysonic_database_creation +- name: import DATA in database in case of creation + become: yes + mysql_db: + name: "{{ supysonic_db_name }}" + state: import + target: "{{supysonic_SQl_target_file}}" + when: supysonic_database_creation.changed == true and supysonic_SQl_target_file is defined - name: "Ensure db user is present" become: yes @@ -97,12 +104,14 @@ - name: enable daemon service systemd: - name: "gunicorn-{{supysonic_name}}.service" # not required. Name of the service. When using in a chroot environment you always need to specify the full name i.e. (crond.service). + name: "{{supysonic_name}}-daemon.service" # not required. Name of the service. When using in a chroot environment you always need to specify the full name i.e. (crond.service). enabled: true + state: started become: yes - name: enable supysonic service systemd: name: "gunicorn-{{supysonic_name}}.service" # not required. Name of the service. When using in a chroot environment you always need to specify the full name i.e. (crond.service). enabled: true + state: started become: yes \ No newline at end of file diff --git a/templates/supysonic.j2 b/templates/supysonic.j2 index 484c4a3..adeaa6a 100644 --- a/templates/supysonic.j2 +++ b/templates/supysonic.j2 @@ -35,7 +35,7 @@ log_level = {{supysonic_log_level}} ; This prevents running too many scans when multiple changes are detected for a ; single file over a short time span. Default: 5 wait_delay = 5 -socket = /var/supysonic/supysonic.sock +socket = /var/run/supysonic.sock ; Optional rotating log file for the scanner daemon. Logs to stderr if empty log_file = /var/supysonic/supysonic-daemon.log