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

Hosts keep getting replaced #249

Open
crazycodr opened this issue Dec 12, 2017 · 1 comment
Open

Hosts keep getting replaced #249

crazycodr opened this issue Dec 12, 2017 · 1 comment

Comments

@crazycodr
Copy link

I made a completely variable setup that allows me to generate similar machines but the names, hostname, etc are controlled by startup flags.

namespace="learningbird"
ssh_user="lb-user"
machine_type="app"
begin
    opts.each do |opt, arg|
        case opt
            when '--namespace'
                namespace=arg
            when '--machine-type'
                machine_type=arg
        end
    end
rescue GetoptLong::InvalidOption => e
    # Do nothing, we want vagrant to process its own parameters too
end

This allows me to have only one definition in my file like so:

    config.vm.define "#{namespace}-#{machine_type}", primary: true do |definition|

But because of that, i think, the machines that hostmanager sees are always and only the 1 machine that i brought up. So this means that my hosts file is always getting rewritten with the latest machine i am bringing up which is kinda annoying.

Is there anything i can do about that?

@crazycodr
Copy link
Author

Also, when i use machine-type or namespace parameter, it says at the end

==> dan-queue: Running provisioner: hostmanager...
The machine with the name 'dan-queue' was not found configured for
this Vagrant environment.

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

No branches or pull requests

1 participant