Commit 4d8db75a by e0d

Play to create the analytics db and users

parent e41be5ff
- name: Create analtyics reports db
hosts: all
connection: local
gather_facts: False
tasks:
# Install required library
#- name: install python mysqldb module
# apt: pkg={{item}} install_recommends=no state=present update_cache=yes
# sudo: yes
# with_items:
# - python-mysqldb
- name: create mysql databases for the analytics report API
mysql_db: >
db={{ item.key }}
state={{ item.value.state }}
encoding={{ item.value.encoding }}
login_host={{ item.value.login_host }}
login_user={{ item.value.login_user }}
login_password={{ item.value.login_password }}
with_dict: databases
- name: create mysql users and assign privileges
mysql_user: >
name="{{ item.key }}"
priv="{{ '/'.join(item.value.privileges) }}"
password="{{ item.value.password }}"
host={{ item.value.host }}
login_host={{ item.value.login_host }}
login_user={{ item.value.login_user }}
login_password={{ item.value.login_password }}
append_privs=yes
with_dict: database_users
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment