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

Fix host file management for Linux and Windows hosts #234

Merged
merged 2 commits into from
Jul 11, 2017

Conversation

BadgerOps
Copy link
Contributor

This PR (correctly this time!) resolves #232 #228 #231 and #229.

My initial commit fixed windows, but broke linux and I didn't catch it during testing as I was only running hostmaster on the windows box. This morning I realized the breakage on the linux side and fixed that. Rather than creating /tmp/hosts for linux hosts I opted to just put the hosts.#{machine.name} directly in /tmp as on windows we're already moving it, and adding the rm for linux hosts.

I tested with 3 nodes several times to ensure this worked as expected:
RHEL7
CentOS 6
Windows 2012

@nick-oconnor
Copy link

nick-oconnor commented May 12, 2017

+1 for the PR. Any progress on getting this merged?

@austinlparker
Copy link
Contributor

@seth-reeser bumping this PR in lieu of #229 - we're still impacted by this. Any update?

@jeffp123
Copy link

jeffp123 commented May 28, 2017

I had to add quotes to line 68 to handle paths that have spaces in them, so that copy will work:

            copy_proc = Proc.new { `[ -w "#{hosts_location}" ] && cat "#{file}" > "#{hosts_location}" || sudo cp "#{file}" "#{hosts_location}"` }

PR here:
#236

@BadgerOps
Copy link
Contributor Author

Spaces are such a pesky problem :)

@jugatsu
Copy link

jugatsu commented Jun 2, 2017

Guys, any progress on merging this PR?

I'm also stuck with #231

@jeffp123
Copy link

jeffp123 commented Jun 5, 2017

@jugatsu You can locally check out this PR and then use rake build and then vagrant plugin install /path/to/plugin to use this change now.

@MadelineRitchie
Copy link

Thanks everyone

I just learned how to checkout a PR and do rake build. Here are the detailed steps I just used for anyone who may find this useful:

vagrant plugin uninstall vagrant-hostmanager
git clone --depth 1 https://github.com/devopsgroup-io/vagrant-hostmanager
cd vagrant-hostmanager/
git fetch origin pull/234/head:234
git checkout 234
rake gem:build
vagrant plugin install pkg/vagrant-hostmanager-1.8.6.gem

I personally renamed the resulting gem to -hotfixed.gem and checked it into my team's shared vagrant box sourcecontrol, for now. It was ~25k in size.

@BadgerOps
Copy link
Contributor Author

Hey @seth-reeser - sorry to keep bugging you, but it would be helpful to get this merge accepted! Any further changes or testing that I can do to help the process along? Thanks!

@reist
Copy link

reist commented Jun 27, 2017

I'm using JasonRitchie's script as part of the setup. That's the only way things work for our devs, both on linux and on macs.
Would be really nice to see this merged.

@knutjda
Copy link

knutjda commented Jul 11, 2017

Please merge! This fix helps us, and for the moment we have to distribute a custom build of the plugin to our devs.

@seth-reeser seth-reeser merged commit d660557 into devopsgroup-io:master Jul 11, 2017
@seth-reeser
Copy link
Member

v1.8.7 has been released with this merged.

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

9 participants