Running mariadb-tzinfo-to-sql with Ansible
Demonstrates how to automate the loading of time zone data into MariaDB using the `mysql_tzinfo_to_sql` utility, with techniques to ensure the task is idempotent.
Installing or Upgrading the Package
- name: Update timezone info
tags: [ timezone-update ]
apt:
name: tzdata
state: latest
install_recommends: no
register: timezone_infoRunning the Script
- name: Move system timezone info into MariaDB
tags: [ timezone-update ]
shell: >
mysql_tzinfo_to_sql /usr/share/zoneinfo \
| grep -v "^Warning" \
| mysql --database=mysql
when: timezone_info.changedUsing Galera
Last updated
Was this helpful?

