Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/parklab/refinery-platform
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
flekschas committed Feb 11, 2016
2 parents 8b45b64 + b7a4512 commit 17f94e5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion deployment/aws-config/10default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@

# The name of the pre-existing RDS instance to connect to.
# (must use the PostgreSQL engine)
# RDS_SUPERUSER_NAME: "rds-refinery"
# RDS_NAME: "rds-refinery"

# The name of the RDS superuser account.
# RDS_SUPERUSER_NAME:
# FIXED to "root"

# The password for the RDS superuser account.
# RDS_SUPERUSER_PASSWORD: "mypassword"

# The name of the PostgreSQL role to create.
RDS_ROLE: "refinery"
7 changes: 6 additions & 1 deletion deployment/aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ cd /srv/refinery-platform/deployment

# Discover IP endpoint for our PostgreSQL RDS, and place it in
# environment variables for puppet/facter to use
bin/aws-rds-endpoint db20160111 > /home/ubuntu/rds
: ${RDS_NAME?RDS_NAME must be set}
bin/aws-rds-endpoint "$RDS_NAME" > /home/ubuntu/rds

# FACTER environment variables become facts for puppet;
# see https://puppetlabs.com/blog/facter-part-1-facter-101
export FACTER_RDS_HOST=$(jq -r .Address /home/ubuntu/rds)
export FACTER_RDS_PORT=$(jq -r .Port /home/ubuntu/rds)
export FACTER_RDS_ROLE="$RDS_ROLE"

# Create RDS user and database here, instead of using puppet
# (because drj couldn't work out how to do it in puppet)
Expand Down
3 changes: 2 additions & 1 deletion deployment/bin/ensure-postgresql-role
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

USER=ubuntu
# Name and password of PostgreSQL role to create.
USER=${RDS_ROLE:-refinery}
PASSWORD=${PASSWORD-password}

HOST=$(jq -r .Address /home/ubuntu/rds)
Expand Down
1 change: 1 addition & 0 deletions deployment/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def main():
"#!/bin/sh\n",
"RDS_NAME=", config['RDS_NAME'], "\n",
"RDS_SUPERUSER_PASSWORD=", config['RDS_SUPERUSER_PASSWORD'], "\n",
"RDS_ROLE=", config['RDS_ROLE'], "\n",
"GIT_BRANCH=", commit, "\n",
"\n",
open('bootstrap.sh').read(),
Expand Down
2 changes: 1 addition & 1 deletion refinery/config/config.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"NAME": "refinery",
"PASSWORD": "<%= @rds_role_password %>",
"PORT": "<%= @rds_port %>",
"USER": "<%= @app_user || "vagrant" %>"
"USER": "<%= @rds_role || "vagrant" %>"
}
},
"DEFAULT_FROM_EMAIL": "webmaster@localhost",
Expand Down

0 comments on commit 17f94e5

Please sign in to comment.