mirror of
https://github.com/HanXHX/ansible-mysql.git
synced 2026-04-09 13:42:10 +07:00
Delete root password management
On Buster, it uses socket auth.
This commit is contained in:
@@ -1,29 +1,5 @@
|
||||
---
|
||||
|
||||
- name: SHELL | Get MariaDB target version
|
||||
shell: "LANG=C apt-cache depends mariadb-server | awk -F '-' '/Depends/ { print $NF }'"
|
||||
register: apt_mariadb_version
|
||||
changed_when: false
|
||||
|
||||
- block:
|
||||
|
||||
- name: DEBCONF | Prepare MariaDB silent installation (root password)
|
||||
debconf:
|
||||
name: 'mariadb-server-{{ apt_mariadb_version.stdout }}'
|
||||
question: 'mysql-server/root_password'
|
||||
vtype: 'password'
|
||||
value: '{{ mariadb_root_password }}'
|
||||
when: not mariadb_exists.stat.exists
|
||||
|
||||
- name: DEBCONF | Prepare MariaDB silent installation (root password again)
|
||||
debconf:
|
||||
name: 'mariadb-server-{{ apt_mariadb_version.stdout }}'
|
||||
question: 'mysql-server/root_password_again'
|
||||
vtype: 'password'
|
||||
value: '{{ mariadb_root_password }}'
|
||||
|
||||
when: not mariadb_exists.stat.exists and mariadb_root_password is string
|
||||
|
||||
- name: APT | Install MariaDB server
|
||||
apt:
|
||||
pkg: mariadb-server
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
---
|
||||
|
||||
- block:
|
||||
|
||||
- name: SET_FACT | Bypass https://github.com/ansible/ansible/issues/19874
|
||||
set_fact:
|
||||
ansible_distribution_release: 'buster'
|
||||
|
||||
when: ansible_facts.distribution_major_version == "buster/sid"
|
||||
|
||||
- name: INCLUDE_VARS | Related to OS version
|
||||
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
|
||||
|
||||
@@ -40,15 +32,6 @@
|
||||
(config.changed or extraconfig.changed) and
|
||||
not mariadb_galera_resetup
|
||||
|
||||
- name: TEMPLATE Create .my.cnf for root
|
||||
template:
|
||||
src: root/my.cnf
|
||||
dest: /root/.my.cnf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
backup: yes
|
||||
|
||||
- name: INCLUDE | Galera
|
||||
import_tasks: galera/main.yml
|
||||
when: mariadb_use_galera
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
---
|
||||
|
||||
- name: MYSQL_USER | Update mysql root password for all root accounts
|
||||
mysql_user:
|
||||
name: root
|
||||
host: "{{ item }}"
|
||||
password: "{{ mariadb_root_password }}"
|
||||
loop:
|
||||
- "{{ ansible_hostname }}"
|
||||
- 127.0.0.1
|
||||
- ::1
|
||||
- localhost
|
||||
|
||||
- name: MYSQL_USER | Remove all anonymous users
|
||||
mysql_user:
|
||||
name: ''
|
||||
|
||||
Reference in New Issue
Block a user