Skip to content

Action for adding of custom configs #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions scripts/ms-mm-configuration.jps
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ onInstall:
masterId: "${nodes.sqldb.master.id}"

- forEach(n:nodes.sqldb):
if ('${@n.id}' != '${nodes.sqldb.master.id}'):
if ('${@n.id}' != '${nodes.sqldb[1].id}'):
addDistSlave:
id: "${@n.id}"
- if ('${nodes.sqldb.master.id}' == '${nodes.sqldb.first.id}' && '${@n.id}' != '${nodes.sqldb.master.id}' && '${@n.id}' != '${nodes.sqldb[1].id}'):
addDistSlave:
id: "${@n.id}"
- if ('${nodes.sqldb.master.id}' != '${nodes.sqldb.first.id}' && '${@n.id}' != '${nodes.sqldb.master.id}' && '${@n.id}' != '${nodes.sqldb.first.id}'):
addDistSlave:
id: "${@n.id}"

- if ('${globals.SCHEME}'.toLowerCase() != 'master'):
- log: "--> Setup Slave Node"
Expand Down Expand Up @@ -113,6 +115,8 @@ actions:
user: root

setupMaster:
- addCustomConfig:
id: "${this.id}"
- cmd[${this.id}]: |-
wget ${globals.PATH}/configs/master.cnf -O /etc/mysql/conf.d/master.cnf &>> /var/log/run.log
sed -i "s/server-id.*/server-id = ${this.id}/" /etc/mysql/conf.d/master.cnf
Expand All @@ -127,6 +131,8 @@ actions:
- setNodeDisplayName[${this.id}]: Slave

addSlave:
- addCustomConfig:
id: "${this.id}"
- setupSlave:
id: "${this.id}"
- setupUser:
Expand Down Expand Up @@ -155,4 +161,7 @@ actions:
addSlave:
id: "${this.id}"
masterId: "${nodes.sqldb.first.id}"


addCustomConfig:
if (!/settings.custom_conf/.test("${globals.CUSTOM_CONF}")):
cmd[${this.id}]: cd /etc/mysql/conf.d && wget ${globals.CUSTOM_CONF} &>> /var/log/run.log