Navigation Menu

Skip to content
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

Make bootstrap.sh handle optional variable to set preferred RDBMS #15

Merged
merged 1 commit into from Dec 19, 2012

Conversation

eggmaster
Copy link
Contributor

Install dependencies for either sqlite or postgresql based on value
of FACTER_RDBMS

@cwolferh
Copy link
Contributor

I think it would be preferable to only define FACTER_RDBMS_DBNAME, FACTER_RDBMS_USERNAME and FACTER_RDBMS_PASSWORD in the postgres case, i.e., wrap lines 28 to 40 inside of an if like:

if [ "x$FACTER_RDBMS" = "xpostgresql" ]; then
  ...define the three facter vars as you currently have
fi

Also, I think the FACTER_DB_USERNAME for postgres is usually going to be $USER (the current logged in user). At least, that is the pattern I have followed thus far but I am not a postgres expert.

@eggmaster
Copy link
Contributor Author

Re: FACTER_DB_USERNAME; I think it's fine to set it to $USER as you suggest.

On the other subject (of only defining FACTER_RDBMS_DBNAME, FACTER_RDBMS_USERNAME and FACTER_RDBMS_PASSWORD in the postgres case), I had that same thought initially. But after we talked about the possibility of a third (or more) possible database backend, I thought that these variables would be generally useful (mysql and oracle both make use of these identifiers, for example).

@cwolferh
Copy link
Contributor

Once we have oracle and/or mysql support, we could define FACTER_RDBMS_DBNAME, FACTER_RDBMS_USERNAME and FACTER_RDBMS_PASSWORD in those cases too... just not sure it makes sense to have those defined in the sqlite case. I'm getting a bit nitpick-y, though.

@eggmaster
Copy link
Contributor Author

I don't have a strong preference (or at least any stronger argument for my way) so I defer to the nit-pickiness :)

@eggmaster
Copy link
Contributor Author

amended commit to reflect the changes we've agreed on here.

Install dependencies for either sqlite or postgresql based on value
of FACTER_RDBMS

Add postgresql install steps to bootstrap.sh, template for database.pg
to puppet templates, puppet step to run rake db:create:all

Make postgresql the default RDBMS selection.
@cwolferh
Copy link
Contributor

Works as advertised. Tested bootstrap.sh using postgres (now the default and recommended DB) on

rhel5 with rbenv 1.9.3
rhel5 with system ruby
rhel5 with rbenv 1.8.7
rhel5 with rbenv 1.9.3 and predefined FACTER_RDBMS_DBNAME
rhel5 weith system ruby sqlite
fc17 with system ruby
fc17 with rbenv 1.8.7
fc17 with rbenv 1.9.3
ubuntu 12.04 with rbenv 1.9.3
ubuntu 12.04 with rbenv 1.8.7

Also tested sqlite (previously existing functionality) still works with rhel5 and fc17.

Nice work!

cwolferh added a commit that referenced this pull request Dec 19, 2012
Postgres support in bootstrap.sh.  Postgres now the default but it is still possible to use sqlite.
@cwolferh cwolferh merged commit 7c37478 into aeolus-incubator:master Dec 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants