Add database port and host configuration to role.

This commit is contained in:
Dorian 2015-05-12 23:48:10 -04:00
parent 4cb24dd580
commit ac3ddb3ee0
3 changed files with 12 additions and 2 deletions

View File

@ -50,6 +50,12 @@ Role Variables
- setup_db: - setup_db:
- Flag whether or not to setup the MySQL database directly on the host. - Flag whether or not to setup the MySQL database directly on the host.
- Default: true - Default: true
- host:
- Flag whether or not to setup the MySQL database directly on the host.
- Default: localhost
- port:
- The port of which MySQL database directly on the host.
- Default: 3306
- rookeries_app_name: - rookeries_app_name:
- Configures the unique name of the rookeries app. - Configures the unique name of the rookeries app.
- Default: rookeries - Default: rookeries

View File

@ -7,6 +7,8 @@ rookeries_db:
username: rookeries username: rookeries
password: system_admin password: system_admin
setup_db: true setup_db: true
host: localhost
port: 3306
# Name of the rookeries app # Name of the rookeries app
rookeries_app_name: rookeries rookeries_app_name: rookeries
@ -26,7 +28,7 @@ rookeries_app_config:
rookeries_secret_key: "development" rookeries_secret_key: "development"
# Database # Database
rookeries_database_uri: "mysql+mysqlconnector://{{ rookeries_db. username}}:{{ rookeries_db.password }}@localhost:3306/{{ rookeries_db.db_name }}?charset=utf8" rookeries_database_uri: "mysql+mysqlconnector://{{ rookeries_db. username}}:{{ rookeries_db.password }}@{{ rookeries_db.host }}:{{ rookeries_db.port }}/{{ rookeries_db.db_name }}?charset=utf8"
# Mail server configuration # Mail server configuration
rookeries_mail_server: "smtp.localhost.net" rookeries_mail_server: "smtp.localhost.net"

View File

@ -7,9 +7,11 @@
when: rookeries_db.setup_db when: rookeries_db.setup_db
- name: setup MySQL databases for rookeries. - name: setup MySQL databases for rookeries.
mysql_db: name={{ rookeries_db.db_name }} state=present mysql_db: name={{ rookeries_db.db_name }} state=present login_host={{ rookeries_db.host }}
login_port={{ rookeries_db.port }}
when: rookeries_db.setup_db when: rookeries_db.setup_db
- name: add MySQL database users for rookeries. - name: add MySQL database users for rookeries.
mysql_user: name={{ rookeries_db.username }} password={{ rookeries_db.password }} priv={{ rookeries_db.db_name }}:ALL mysql_user: name={{ rookeries_db.username }} password={{ rookeries_db.password }} priv={{ rookeries_db.db_name }}:ALL
login_host={{ rookeries_db.host }} login_port={{ rookeries_db.port }}
when: rookeries_db.setup_db when: rookeries_db.setup_db