You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
793 B
38 lines
793 B
---
|
|
- name: install packages
|
|
package:
|
|
name: "{{ mysql_packages_openbsd }}"
|
|
|
|
- name: check if database already exists
|
|
stat:
|
|
path: /var/mysql
|
|
register: db_exists
|
|
|
|
- name: initialize database
|
|
command: /usr/local/bin/mysql_install_db
|
|
when: not db_exists.stat.exists
|
|
|
|
- name: reload facts
|
|
setup:
|
|
|
|
- name: enable and start mysqld
|
|
service:
|
|
name: mysqld
|
|
state: started
|
|
enabled: yes
|
|
|
|
- name: change mysql root password
|
|
mysql_user:
|
|
name: root
|
|
login_unix_socket: /var/run/mysql/mysql.sock
|
|
host: "{{ item }}"
|
|
password: "{{ mysql_root_password }}"
|
|
login_user: root
|
|
login_password: "{{ mysql_root_password }}"
|
|
check_implicit_admin: yes
|
|
priv: "*.*:ALL,GRANT"
|
|
loop:
|
|
- "{{ ansible_hostname }}"
|
|
- 127.0.0.1
|
|
- ::1
|
|
- localhost
|
|
|