2016-03-15 06:54:17 +00:00
|
|
|
---
|
2016-03-17 09:50:21 +00:00
|
|
|
- name: Install MySQLdb in global env
|
|
|
|
pip: name=mysql-python version=1.2.5
|
|
|
|
become: yes
|
|
|
|
become_method: sudo
|
|
|
|
|
2016-03-15 06:54:17 +00:00
|
|
|
- name: Set root Password
|
2016-03-17 07:29:44 +00:00
|
|
|
mysql_user:
|
|
|
|
name=root
|
|
|
|
host={{ item }}
|
|
|
|
password={{ mysql_root_password }}
|
2016-03-15 06:54:17 +00:00
|
|
|
state=present
|
|
|
|
login_user=root
|
|
|
|
with_items:
|
|
|
|
- localhost
|
|
|
|
when: mysql_root_password is defined
|
2016-03-17 09:50:21 +00:00
|
|
|
become: yes
|
|
|
|
become_method: sudo
|
|
|
|
|
|
|
|
# when you have already defined mysql root password
|
|
|
|
ignore_errors: yes
|
2016-03-15 06:54:17 +00:00
|
|
|
|
|
|
|
- name: Add configuration
|
|
|
|
template: src={{ mysql_config_template }} dest={{ mysql_conf_dir }}/frappe.cnf owner=root mode=0644
|
2016-03-17 09:50:21 +00:00
|
|
|
notify:
|
|
|
|
- restart mysql
|
|
|
|
become: yes
|
|
|
|
become_method: sudo
|
|
|
|
|
|
|
|
- name: restart mysql
|
|
|
|
service: name=mysql state=restarted
|
2016-03-15 06:54:17 +00:00
|
|
|
become: yes
|
|
|
|
become_method: sudo
|