Skip to content

Commit

Permalink
issues/17 - fix duplicate dataSource.username and dataSource.password…
Browse files Browse the repository at this point in the history
… entries
  • Loading branch information
jjethwa committed Apr 19, 2016
1 parent 31d4c75 commit 03d85c6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions content/opt/run
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,16 @@ update_user_password () {
sed -i 's,grails.serverURL\=.*,grails.serverURL\='${SERVER_URL}',g' /etc/rundeck/rundeck-config.properties
sed -i 's,dataSource.dbCreate.*,,g' /etc/rundeck/rundeck-config.properties
sed -i 's,dataSource.url = .*,dataSource.url = '${DATABASE_URL}',g' /etc/rundeck/rundeck-config.properties
echo "dataSource.username = rundeck" >> /etc/rundeck/rundeck-config.properties
echo "dataSource.password = ${RUNDECK_PASSWORD}" >> /etc/rundeck/rundeck-config.properties
if grep -q dataSource.username /etc/rundeck/rundeck-config.properties ; then
:

This comment has been minimized.

Copy link
@pschmitt

pschmitt Apr 20, 2016

Why not replace the username in the same fashion as the password? This would fix a manually altered config file.

-> sed -i 's,dataSource.username = .*,dataSource.username = rundeck,g' /etc/rundeck/rundeck-config.properties

This comment has been minimized.

Copy link
@jjethwa

jjethwa Apr 20, 2016

Author Owner

@pschmitt This would allow a user to specify a different database user if required.

else
echo "dataSource.username = rundeck" >> /etc/rundeck/rundeck-config.properties
fi
if grep -q dataSource.password /etc/rundeck/rundeck-config.properties ; then
sed -i 's,dataSource.password = .*,dataSource.password = '${RUNDECK_PASSWORD}',g' /etc/rundeck/rundeck-config.properties
else
echo "dataSource.password = ${RUNDECK_PASSWORD}" >> /etc/rundeck/rundeck-config.properties
fi

# framework.properties
sed -i 's,framework.server.name\ \=.*,framework.server.name\ \=\ '${SERVER_HOSTNAME}',g' /etc/rundeck/framework.properties
Expand Down

0 comments on commit 03d85c6

Please sign in to comment.