Add support to conditionally setup the database.
This commit is contained in:
parent
ffae28aecc
commit
4cb24dd580
|
@ -47,6 +47,9 @@ Role Variables
|
|||
- The database username for the above specified database.
|
||||
- password:
|
||||
- The database username for the above specified database.
|
||||
- setup_db:
|
||||
- Flag whether or not to setup the MySQL database directly on the host.
|
||||
- Default: true
|
||||
- rookeries_app_name:
|
||||
- Configures the unique name of the rookeries app.
|
||||
- Default: rookeries
|
||||
|
|
|
@ -6,6 +6,7 @@ rookeries_db:
|
|||
db_name: rookeries
|
||||
username: rookeries
|
||||
password: system_admin
|
||||
setup_db: true
|
||||
|
||||
# Name of the rookeries app
|
||||
rookeries_app_name: rookeries
|
||||
|
|
|
@ -4,9 +4,12 @@
|
|||
with_items:
|
||||
- mysql-server
|
||||
- python-mysqldb
|
||||
when: rookeries_db.setup_db
|
||||
|
||||
- name: setup MySQL databases for rookeries.
|
||||
mysql_db: name={{ rookeries_db.db_name }} state=present
|
||||
when: rookeries_db.setup_db
|
||||
|
||||
- name: add MySQL database users for rookeries.
|
||||
mysql_user: name={{ rookeries_db.username }} password={{ rookeries_db.password }} priv={{ rookeries_db.db_name }}:ALL
|
||||
when: rookeries_db.setup_db
|
||||
|
|
Loading…
Reference in New Issue