remove secure-auth param if mysql => 8.0.3

Signed-off-by: Sebastian Gumprich <[email protected]>

install collection in molecule

Signed-off-by: Sebastian Gumprich <[email protected]>

remove deprecated ubuntu 16.04 from tests

Signed-off-by: Sebastian Gumprich <[email protected]>
This commit is contained in:
Sebastian Gumprich committed 2021-04-01 13:20:58 +02:00
1 parent d758fa5184
commit 2fb54bd224
6 files changed
+24 -4

No files matched your search

+23
View File
@@ -21,6 +21,29 @@
when: "not lookup('varnames', '^' + item.key + '$')"
with_dict: '{{ os_vars }}'
- name: Gather package facts to check for mysql/mariadb version
ansible.builtin.package_facts:
manager: auto
- name: Check if MySQL or MariaDB is used
set_fact:
mysql_distribution: "{{ ansible_facts.packages['mysql-server'] is defined | ternary('mysql', 'mariadb') }}"
- name: Check which MySQL/MariaDB version is used
community.mysql.mysql_info:
filter: version
login_unix_socket: "{{ login_unix_socket | default(omit) }}"
register: mysql_version
# see https://stackoverflow.com/a/59451077/2953919 for the
# dict2items and vice versa magic
- name: Drop the secure-auth parameter on MySQL >=8.0.3 (not mariadb)
set_fact:
mysql_hardening_options: "{{ mysql_hardening_options| dict2items | rejectattr('key', 'search', 'secure-auth') | list | items2dict }}"
when:
- mysql_version.version.full is version('8.0.3', '>=')
- mysql_distribution == "mysql"
- include: configure.yml
when: mysql_hardening_enabled | bool
tags: