Files
@ 0c330b88956a
Branch filter:
Location: majic-ansible-roles/roles/database_server/tasks/main.yml - annotation
0c330b88956a
1.1 KiB
text/x-yaml
MAR-218: Switch to using task imports instead of includes:
- Should result in somewhat faster run, except the includes happen
during planning phase. None of the changed includes will have
problem with this.
- Solves the issue of (included) imported tasks not being tagged
properly, particularly in relation to the mechanism for explicitly
running all handlers.
- Should result in somewhat faster run, except the includes happen
during planning phase. None of the changed includes will have
problem with this.
- Solves the issue of (included) imported tasks not being tagged
properly, particularly in relation to the mechanism for explicitly
running all handlers.
09625826d96f 09625826d96f 09625826d96f c10934519e18 a20ca43cd967 a20ca43cd967 a20ca43cd967 acd104ed9b5e 91b633aba998 09625826d96f 09625826d96f c10934519e18 0ffaf31692ce 0ffaf31692ce 946da6e35339 09625826d96f e9c5e116996a c10934519e18 2e3f14bc1505 30d5b3fa5b93 30d5b3fa5b93 30d5b3fa5b93 7cabc17c71c3 e9c5e116996a 19b15357124a a3d247bb2e09 a3d247bb2e09 0bc967a67750 0bc967a67750 0bc967a67750 c10934519e18 0ffaf31692ce 0ffaf31692ce e9c5e116996a 7387caca37f3 7387caca37f3 0c330b88956a fcf5abdd3ad5 7387caca37f3 18f93a9a8b05 | ---
- name: Install MariaDB
ansible.builtin.apt:
name:
- mariadb-client
- mariadb-server
- python3-pymysql
state: present
- name: Enable and start MariaDB
ansible.builtin.service:
name: mysql
state: started
enabled: true
- name: Set UTF-8 encoding as default for MariaDB
ansible.builtin.template:
src: "utf8.cnf.j2"
dest: "/etc/mysql/mariadb.conf.d/90-utf8.cnf"
owner: root
group: root
mode: "0644"
register: mariadb_utf8_configuration
- name: Restart MariaDB in order to use UTF-8 as default character set # noqa no-handler
# [no-handler] Tasks that run when changed should likely be handlers
# UTF-8 configuration must be applied immediatelly in order to ensure that
# subsequent tasks that create databases will end-up with correct (UTF-8)
# encoding. Otherwise they will be created using default latin1.
ansible.builtin.service:
name: mysql
state: restarted
when: mariadb_utf8_configuration.changed
- name: Explicitly run all handlers
ansible.builtin.import_tasks: ../handlers/main.yml
when: "run_handlers | default(False) | bool()"
tags:
- handlers
|