Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mysql_hardening] Allow setting the mysql_distribution #473

Merged
merged 2 commits into from
Aug 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions roles/mysql_hardening/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@
with_dict: '{{ os_vars }}'
tags: always

- name: Check that the variable mysql_distribution is set correctly
ansible.builtin.assert:
that: mysql_distribution == 'mysql' or mysql_distribution == 'mariadb'
fail_msg: 'mysql_distribution must be set to either mysql or mariadb!'
when: mysql_distribution is defined

- name: Gather package facts to check for mysql/mariadb version
ansible.builtin.package_facts:
manager: auto
when: not mysql_distribution is defined

- name: Check if MySQL or MariaDB is used
set_fact:
mysql_distribution: "{{ ansible_facts.packages['mysql-server'] is defined | ternary('mysql', 'mariadb') }}"
when: not mysql_distribution is defined

- name: Check which MySQL/MariaDB version is used
community.mysql.mysql_info:
Expand Down