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

Add vagrant #186

Merged
merged 13 commits into from
Nov 24, 2014
Merged

Add vagrant #186

merged 13 commits into from
Nov 24, 2014

Conversation

mi-wood
Copy link
Member

@mi-wood mi-wood commented Nov 18, 2014

@cllns @tkwidmer making PR for comments sake

resolve #180

@mi-wood
Copy link
Member Author

mi-wood commented Nov 19, 2014

I'm most familiar with rbenv. rvm, chruby and rbenv will all do what we want. I can set it up with any of them and chruby is in the docs. Any opinions? @tkwidmer

@mi-wood
Copy link
Member Author

mi-wood commented Nov 19, 2014

everything but the db setup is working here. I'm getting the error: 'PG::ConnectionBad: FATAL: database "bathrooms_development" does not exist', but I'm a bit too tired to keep digging atm

@mi-wood
Copy link
Member Author

mi-wood commented Nov 19, 2014

Also, I changed the wiki, but I don't like that you can PR and would prefer moving back to the README. That may be a personal preference though.

@mi-wood
Copy link
Member Author

mi-wood commented Nov 19, 2014

Also, I'll probably turn this into a chef cookbook if it gets and more complex/I have any more bash issues. It would honestly have been about the same amount of code 😒

@gnarf
Copy link
Contributor

gnarf commented Nov 19, 2014

You can also use CONTRIBUTING.md
On Nov 19, 2014 2:29 AM, "Mike Wood" [email protected] wrote:

Also, I'll probably turn this into a chef cookbook if it gets and more
complex/I have any more bash issues. It would honestly have been about the
same amount of code [image: 😒]


Reply to this email directly or view it on GitHub
#186 (comment)
.

@cllns
Copy link
Contributor

cllns commented Nov 19, 2014

Awesome, thanks @mi-wood.

I added --createdb and --superuser flag to the postgres createuser vagrant command.
The former is needed to allow the user to create databases and the latter is needed to add the unaccent extension.

One more thing that I needed to change to get this to work is, on the VM, change the authentication methods for postgres (/etc/postgresql/9.3/main/pg_hba.conf). The METHOD for the last three need to be 'trust' instead of 'md5'/'peer'. (We could probably change the first one too but it's not necessary and seems like it could be bad). After that, the script should restart postgres.

A few other small things:

  1. ruby-build installed ruby over HTTP instead of HTTPS. It looks like that fix is coming soon though, so maybe we ought not worry about it: Use HTTPS when fetching packages from cloudfront rbenv/ruby-build#663
  2. After I do vagrant up, it makes the box and runs the setup script. After it exits, I need to run vagrant up a second time to actually start it. Not sure why that happens
  3. I don't think bundle ran in the proper directory for me. Not sure why, the code in setup.sh looks like it clearly cds properly, but I needed to run bundle again after cding into refugerestrooms. Also I think bundler should run without the --quiet flag. It feels better to see the packages being installed, in my opinion.

@tkwidmer
Copy link
Contributor

We can move to a contributing.md file

@mi-wood
Copy link
Member Author

mi-wood commented Nov 19, 2014

@cllns Did the localhost -> "" workaround not alleviate the postgres permission issue? I wanted to avoid touching the pg_hba.conf, since it requires templating to avoid touching it manually. I know this is a hack, so I can just work on a chef cookbook instead, since it would help a lot with anything like this.

Removed the bundle quiet flag, since it does look like it's just hanging. I'll see if the --gemfile helps too.

Adding contributing.md. We can always merge this when it's ready and I'll work on chef in the meantime.

@tkwidmer
Copy link
Contributor

Ill let you merge it yourself when its functional

@mi-wood
Copy link
Member Author

mi-wood commented Nov 19, 2014

@cllns I don't have to modify the postgres configs to have this work start to finish. Can you double check this PR and then I'll merge it?

@gnarf
Copy link
Contributor

gnarf commented Nov 22, 2014

Could we add

  config.vm.box_url = "https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/1/providers/virtualbox.box"

to download the box automatically?

@gnarf
Copy link
Contributor

gnarf commented Nov 22, 2014

also i think it needs new ruby versions, etc because of #175

@mi-wood
Copy link
Member Author

mi-wood commented Nov 22, 2014

@gnarf I believe the box already should download from the vagrant cloud by default, but I could be wrong.

The script pulls from the .ruby-version file, so it will update ruby whenever that file is updated in the repo.

I found a workaround for templating the postgres conf, so I'll put that fix in this weekend and this can be merged.

@mi-wood
Copy link
Member Author

mi-wood commented Nov 22, 2014

To confirm this functionality, 'If config.vm.box is a shorthand to a box in Vagrant Cloud then this value doesn't need to be specified.' https://docs.vagrantup.com/v2/vagrantfile/machine_settings.html

@gnarf
Copy link
Contributor

gnarf commented Nov 22, 2014

Maybe I was using an out of date vagrant
On Nov 22, 2014 1:41 PM, "Mike Wood" [email protected] wrote:

To confirm this functionality, 'If config.vm.box is a shorthand to a box
in Vagrant Cloud then this value doesn't need to be specified.'
https://docs.vagrantup.com/v2/vagrantfile/machine_settings.html


Reply to this email directly or view it on GitHub
#186 (comment)
.

@mi-wood
Copy link
Member Author

mi-wood commented Nov 24, 2014

vagrant up is working now with benign warning only. vagrant provision should be idempotent also. I'm merging this since it doesn't touch prod. 🚀

mi-wood added a commit that referenced this pull request Nov 24, 2014
@mi-wood mi-wood merged commit 0cc54b2 into develop Nov 24, 2014
@mi-wood mi-wood deleted the add-vagrant branch November 24, 2014 04:10
@tkwidmer tkwidmer mentioned this pull request Jan 31, 2015
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.

Create Vagrantfile for easier development
4 participants