Commit 66a7568b authored by Chris Croome's avatar Chris Croome

test debug

parent e2c9d052
Pipeline #12629 passed with stage
in 22 seconds
......@@ -34,58 +34,14 @@
tags:
- mariadb
- name: Set the MariaDB root password
block:
- name: Generate a root password when /root/.my.cnf doesn't exist
block:
- name: Generate a random password for MariaDB root
command: pwgen -n 20 1
register: mariadb_root_password_gen
# no_log: true
- name: Set a fact for the mariadb_root_password
set_fact:
mariadb_root_password: "{{ mariadb_root_password_gen.stdout | trim }}"
# no_log: true
when: root_mycnf_stat.stat.exists == False
tags:
- mariadb
# https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
- name: Enable MariaDB root logins with a password
#command: mysql -uroot -p{{ mariadb_root_password }} -e "UPDATE mysql.user SET authentication_string=PASSWORD('{{ mariadb_root_password }}'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost'; FLUSH PRIVILEGES;"
command: mysql -uroot -e "UPDATE mysql.user SET authentication_string=PASSWORD('{{ mariadb_root_password }}'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost'; FLUSH PRIVILEGES;"
# no_log: true
- name: MariaDB root password written to /root/.my.cnf
template:
src: templates/root.my.cnf.j2
dest: /root/.my.cnf
owner: root
group: root
mode: 0400
force: true
# no_log: true
- name: Set the MariaDB root password
include_tasks: mariadb_root_password.yml
when: ( mariadb_root_password is defined ) and ( mariadb_root_password == "set" )
tags:
- mariadb
# https://mariadb.com/kb/en/authentication-plugin-unix-socket/
- name: Set the MariaDB root use to use socket authentication
block:
- name: Enable MariaDB root logins with a socket
command: mysql -uroot -p{{ mariadb_root_password }} -e "UPDATE USER root IDENTIFIED VIA unix_socket; FLUSH PRIVILEGES;" mysql
- name: Remove /root/.my.cnf
file:
path: /root/.my.cnf
state: absent
include_tasks: mariadb_root_socket.yml
when: ( mariadb_root_password is defined ) and ( mariadb_root_password == "socket" )
tags:
- mariadb
......
---
- name: Set the MariaDB root password
block:
- name: Generate a root password when /root/.my.cnf doesn't exist
block:
- name: Generate a random password for MariaDB root
command: pwgen -n 20 1
register: mariadb_root_password_gen
# no_log: true
- name: Set a fact for the mariadb_root_password
set_fact:
mariadb_root_password: "{{ mariadb_root_password_gen.stdout | trim }}"
# no_log: true
when: root_mycnf_stat.stat.exists == False
tags:
- mariadb
# https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
- name: Enable MariaDB root logins with a password
#command: mysql -uroot -p{{ mariadb_root_password }} -e "UPDATE mysql.user SET authentication_string=PASSWORD('{{ mariadb_root_password }}'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost'; FLUSH PRIVILEGES;"
command: mysql -uroot -e "UPDATE mysql.user SET authentication_string=PASSWORD('{{ mariadb_root_password }}'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost'; FLUSH PRIVILEGES;"
# no_log: true
- name: MariaDB root password written to /root/.my.cnf
template:
src: templates/root.my.cnf.j2
dest: /root/.my.cnf
owner: root
group: root
mode: 0400
force: true
# no_log: true
tags:
- mariadb
...
---
# https://mariadb.com/kb/en/authentication-plugin-unix-socket/
- name: Set the MariaDB root use to use socket authentication
block:
- name: Enable MariaDB root logins with a socket
command: mysql -uroot -p{{ mariadb_root_password }} -e "UPDATE USER root IDENTIFIED VIA unix_socket; FLUSH PRIVILEGES;" mysql
- name: Remove /root/.my.cnf
file:
path: /root/.my.cnf
state: absent
tags:
- mariadb
...
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment