Skip to content
Snippets Groups Projects
Commit e2c9dcee authored by ale's avatar ale
Browse files

Merge branch 'mariadb-fix-upgrade-restart' into 'master'

mariadb: stop/start all instances via mariadb.service

See merge request !231
parents cf4d0cdf d2d5f45b
No related branches found
No related tags found
1 merge request!231mariadb: stop/start all instances via mariadb.service
[Unit]
Description=MariaDB database server (placeholder)
[Service]
Restart=no
Type=oneshot
RemainAfterExit=true
ExecStartPre=
ExecStart=
ExecStart=/bin/true
...@@ -24,7 +24,7 @@ PartOf=mariadb.service ...@@ -24,7 +24,7 @@ PartOf=mariadb.service
ConditionPathExists=/etc/mysql/conf.d/my%I.cnf ConditionPathExists=/etc/mysql/conf.d/my%I.cnf
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target mariadb.service
#Alias=mysql.service #Alias=mysql.service
#Alias=mysqld.service #Alias=mysqld.service
......
...@@ -83,13 +83,34 @@ ...@@ -83,13 +83,34 @@
state: stopped state: stopped
name: "{{ item }}" name: "{{ item }}"
with_items: with_items:
- mariadb.service
- mysql.service - mysql.service
- mysqld.service - mysqld.service
ignore_errors: yes ignore_errors: yes
notify: "systemctl reset-failed" notify: "systemctl reset-failed"
changed_when: false changed_when: false
# Ship a placeholder mariadb.service which does not start a server instance.
# The unit is used by mariadb@.service to hook into the package upgrade
# process:
# - mariadb@.service is PartOf=mariadb.service
# - mariadb@.service is WantedBy=mariadb.service
# The mariadb-server package runs stop/start mariadb.service, this way we are
# ensuring that all float-managed instances are also stopped/started during
# upgrades.
- name: Install mariadb placeholder systemd unit
copy:
src: mariadb.service
dest: /etc/systemd/system/mariadb.service
register: mariadb_systemd_unit
- name: Enable mariadb placeholder systemd unit
systemd:
masked: no
enabled: yes
state: started
name: mariadb.service
daemon_reload: "{{ mariadb_systemd_unit.changed }}"
- name: Install mariadb multi-instance base systemd unit - name: Install mariadb multi-instance base systemd unit
copy: copy:
src: mariadb@.service src: mariadb@.service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment