Add database port and host configuration to role.
This commit is contained in:
parent
4cb24dd580
commit
ac3ddb3ee0
|
@ -50,6 +50,12 @@ Role Variables
|
|||
- setup_db:
|
||||
- Flag whether or not to setup the MySQL database directly on the host.
|
||||
- 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:
|
||||
- Configures the unique name of the rookeries app.
|
||||
- Default: rookeries
|
||||
|
|
|
@ -7,6 +7,8 @@ rookeries_db:
|
|||
username: rookeries
|
||||
password: system_admin
|
||||
setup_db: true
|
||||
host: localhost
|
||||
port: 3306
|
||||
|
||||
# Name of the rookeries app
|
||||
rookeries_app_name: rookeries
|
||||
|
@ -26,7 +28,7 @@ rookeries_app_config:
|
|||
rookeries_secret_key: "development"
|
||||
|
||||
# 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
|
||||
rookeries_mail_server: "smtp.localhost.net"
|
||||
|
|
|
@ -7,9 +7,11 @@
|
|||
when: rookeries_db.setup_db
|
||||
|
||||
- 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
|
||||
|
||||
- name: add MySQL database users for rookeries.
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue