mariadb install from tar archive - systemd daemon-reload fails

78 views
Skip to first unread message

dulh...@mailbox.org

unread,
Jan 17, 2022, 9:05:40 AM1/17/22
to ansible...@googlegroups.com
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?

Parth Patel

unread,
Jan 17, 2022, 9:40:17 AM1/17/22
to ansible...@googlegroups.com
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

dulh...@mailbox.org

unread,
Jan 17, 2022, 11:41:14 AM1/17/22
to ansible...@googlegroups.com

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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1268719660.340750.1642428320307%40office.mailbox.org.
Reply all
Reply to author
Forward
0 new messages