Skip to content
Snippets Groups Projects
Commit e6082632 authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

reapplying a fix to the mysql role

Former-commit-id: 382ffff4
parent a85b779a
No related branches found
No related tags found
No related merge requests found
...@@ -10,17 +10,18 @@ ...@@ -10,17 +10,18 @@
with_items: "{{ server_packages }}" with_items: "{{ server_packages }}"
become: true become: true
when: ansible_os_family == "RedHat" when: ansible_os_family == "RedHat"
- name: make sure mysql conf directory exists
file: dest=/etc/mysql/conf.d state=directory
become: true
register: mysqldb_confdir_create
- name: "Starting MySQL" - name: "Starting MySQL"
service: name={{ sqlServiceName }} state=started enabled=true service: name={{ sqlServiceName }} state=started enabled=true
become: true become: true
- name: make sure mysql conf directory exists
file: dest=/etc/mysql/conf.d state=directory
become: true
#- name: "Adding root" #- name: "Adding root"
# sudo: true # become: true
# mysql_user: name=root host="{{ item }}" password="{{ mysql_root_password }}" login_user=root login_password="{{ mysql_root_password }}" check_implicit_admin=yes # mysql_user: name=root host="{{ item }}" password="{{ mysql_root_password }}" login_user=root login_password="{{ mysql_root_password }}" check_implicit_admin=yes
# with_items: # with_items:
# - "{{ ansible_hostname }}" # - "{{ ansible_hostname }}"
...@@ -28,9 +29,10 @@ ...@@ -28,9 +29,10 @@
# - ::1 # - ::1
# - localhost # - localhost
- name: update mysql root password for all root accounts - name: update mysql root password for all root accounts # this will only work if a completely fresh db gets installed because it gets shipped with a blank root pw
mysql_user: name=root host=localhost password={{ mysql_root_password }} login_user=root mysql_user: name=root host=localhost password={{ mysql_root_password }} login_user=root
when: mysqldb_confdir_create.changed
- 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 }}
......
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