# mariadb install from tar archive - systemd daemon-reload fails

**URL:** <https://forum.ansible.com/t/mariadb-install-from-tar-archive-systemd-daemon-reload-fails/36206>\
**Category:** Ansible Project\
**Created:** [January 17, 2022, 2:05pm UTC](https://forum.ansible.com/t/mariadb-install-from-tar-archive-systemd-daemon-reload-fails/36206 "2022-01-17T14:05:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [January 17, 2022, 2:05pm UTC](https://forum.ansible.com/t/mariadb-install-from-tar-archive-systemd-daemon-reload-fails/36206/1 "2022-01-17T14:05:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Parth\_Patel](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@Parth\_Patel](https://forum.ansible.com/u/Parth_Patel)\
**Post date:** [January 17, 2022, 2:37pm UTC](https://forum.ansible.com/t/mariadb-install-from-tar-archive-systemd-daemon-reload-fails/36206/2 "2022-01-17T14:37:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [January 17, 2022, 4:40pm UTC](https://forum.ansible.com/t/mariadb-install-from-tar-archive-systemd-daemon-reload-fails/36206/3 "2022-01-17T16:40:56Z")

</div>

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
