Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (32 sloc) 952 Bytes
---
- name: Copy file with owner and permissions
copy:
src: mysql.repo
dest: /etc/yum.repos.d/mysql.repo
owner: root
group: root
mode: '0644'
force: no
- name: Copy file with owner and permissions
copy:
src: RPM-GPG-KEY-mysql
dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
owner: root
group: root
mode: '0644'
force: no
- name: Install MySQL server and connectors packages
package: name={{ item }} state=present
with_items: "{{ rpms_mysql }}"
- name: Enable and start MySQL Server
systemd:
name=mysqld enabled=yes
name=mysqld state=started
ignore_errors: yes
- name: Find temporary password
shell: >
awk '$0 ~ "temporary password" {print $11}'
register: mysql_root_password_temp
tags: register
- name: Set new password from temporary password
shell: mysql -e 'SET PASSWORD = PASSWORD({{ mysql_root_password }})' -uroot -p"{{ mysql_root_password_temp.stdout }}"
You can’t perform that action at this time.