mariadb install from tar archive - systemd daemon-reload fails

I am trying to install mariadb from a tar-archive and then make systemd mange the service with these 5 TASKS

  • name: install mariadb - run the install script
    shell:
    cmd: ./mariadb-install-db --defaults-file=/opt/db/data/mysql/my.cnf --user=mysql --basedir=/opt/db/mysql/mariadb --datadir=/opt/db/data/mysql --skip-name-resolve
    chdir: “{{ mariadb_base }}/mariadb/scripts”
    become: yes
    become_user: “{{ mariadb_user }}”

  • name: systemd - cp ‘mysql.server’ >> ‘/etc/systemd/system/mysql.service’
    copy:
    src: /opt/db/mysql/mariadb/support-files/mysql.server
    dest: /etc/systemd/system/mysql.service
    remote_src: yes
    become: yes

  • name: systemd deamon-reload
    systemd:
    daemon_reload: yes
    become: yes

- name: systemd - enable mysql.service in systemd
systemd:
name: mysql.service
enabled: yes
become: yes

  • name: systemd - start mysql.service via systemd
    systemd:
    name: mysql.service
    state: started
    become: yes

Installation runs trough but I am getting an error with the 4th TASK enabling the mysql.service in systemd

TASK [mariadb_install : systemd - enable mysql.service in systemd] ********************************************************************************************************
fatal: [vm-51150-0198.intern]: FAILED! => changed=false
msg: ‘Error loading unit file ‘‘mysql.service’’: org.freedesktop.DBus.Error.InconsistentMessage “Unit mysql.service failed to loaded properly: Bad message.”’

can anybody advise me where my error may be lying and how to get around it?

Hey, Make last 3 tasks as below.

Make changes in green and give a try.

Secondly Is there any specific reason why become: yes is used in every task ? Why not its defined once at play level ?

  • name: systemd deamon-reload
    systemd:
    state: restarted
    daemon_reload: yes

- name: systemd - enable mysql.service in systemd
service:
name: mysql.service
enabled: yes

  • name: systemd - start mysql.service via systemd
    service:
    name: mysql.service
    state: started

my mistake was the choice of the service file to use (/opt/db/mysql/mariadb/support-files/mysql.server)

In my particular environment another service file was to be used