ansible-role-mysql/tasks/manage-mysql-service.yml

17 lines
491 B
YAML

---
- name: manage-mysql-service | Ensure that the mysql server is enabled and running
ansible.builtin.service:
name: "{{ mysql_service_name }}"
state: started
enabled: true
when: mysql_enabled
tags: ['mysql', 'mariadb']
- name: manage-mysql-service | Stop and disable the mysql server if we do not want it running
ansible.builtin.service:
name: "{{ mysql_service_name }}"
state: stopped
enabled: false
when: not mysql_enabled
tags: ['mysql', 'mariadb']