Skip to content
Snippets Groups Projects
Commit aece209f authored by Jafar Lie's avatar Jafar Lie
Browse files

fixed roles for mysql

Former-commit-id: 543d97db
parent bd7130a1
No related branches found
No related tags found
No related merge requests found
...@@ -30,12 +30,18 @@ ...@@ -30,12 +30,18 @@
- name: "Adding user database" - name: "Adding user database"
mysql_db: name={{ mysql_user_db_name }} state=present login_user=root login_password={{ mysql_root_password }} mysql_db: name={{ mysql_user_db_name }} state=present login_user=root login_password={{ mysql_root_password }}
become: true
become_user: root
- name: "Giving priviliges to user" - name: "Giving priviliges to user"
mysql_user: name={{ mysql_user_name }} host={{ mysql_user_host }} password={{ mysql_user_password }} login_user=root login_password={{ mysql_root_password }} priv={{ mysql_user_db_name }}.*:ALL,GRANT state=present mysql_user: name={{ mysql_user_name }} host={{ mysql_user_host }} password={{ mysql_user_password }} login_user=root login_password={{ mysql_root_password }} priv={{ mysql_user_db_name }}.*:ALL,GRANT state=present
when: mysql_user_host is defined when: mysql_user_host is defined
become: true
become_user: root
- name: "Giving priviliges to user" - name: "Giving priviliges to user"
mysql_user: name={{ mysql_user_name }} host={{ hostvars[item].ansible_fqdn }} password={{ mysql_user_password }} login_user=root login_password={{ mysql_root_password }} priv={{ mysql_user_db_name }}.*:ALL,GRANT state=present mysql_user: name={{ mysql_user_name }} host={{ hostvars[item].ansible_fqdn }} password={{ mysql_user_password }} login_user=root login_password={{ mysql_root_password }} priv={{ mysql_user_db_name }}.*:ALL,GRANT state=present
with_items: "{{ mysql_user_hosts_group }}" with_items: "{{ mysql_user_hosts_group }}"
when: mysql_user_hosts_group is defined when: mysql_user_hosts_group is defined
become: true
become_user: root
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment