roles/mariadb: Add plays for creating WordPress db/users

Relies on the host having a dict with appropriate values defined,
for example:

  wordpress_blogs:
    - site_name:            blah.com
      wordpress_version:    3.9.2
      wordpress_db_user:    db_user
      wordpress_db_name:    db_name
      wordpress_db_pass:    V9&XvvKu1hYl

Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
Alan Orth 2014-08-28 12:47:30 +03:00
parent fafd475f6b
commit 850a6a8da3
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -33,4 +33,14 @@
template: src=.my.cnf.j2 dest=/root/.my.cnf owner=root mode=0600 template: src=.my.cnf.j2 dest=/root/.my.cnf owner=root mode=0600
tags: mariadb tags: mariadb
- name: Create WordPress database(s)
mysql_db: db={{ item.wordpress_db_name }} state=present
with_items: wordpress_blogs
tags: mariadb
- name: Create WordPress user(s)
mysql_user: name={{ item.wordpress_db_user }} password={{ item.wordpress_db_pass }} priv={{ item.wordpress_db_name }}.*:ALL state=present
with_items: wordpress_blogs
tags: mariadb
# vim: set ts=2 sw=2: # vim: set ts=2 sw=2: