projectatomic / adb-vagrant-registration

A plugin to add "register" and "unregister" capabilities to Vagrant guests.
GNU General Public License v2.0
50 stars 24 forks source link

Registration happens before hostname is set #136

Open mohd-akram opened 2 years ago

mohd-akram commented 2 years ago

This causes VMs to all be registered with the same default box hostname.

kayari75 commented 2 years ago

Same problem for me.

eusebium commented 1 year ago

Used this workaround

            def vagrant_registration(name, config)
                if Vagrant.has_plugin?("vagrant-registration")
                    # https://github.com/projectatomic/adb-vagrant-registration
                    config.registration.username = ENV['VAGRANT_RHEL_SUBSCRIPTION_USERNAME']
                    config.registration.password = ENV['VAGRANT_RHEL_SUBSCRIPTION_PASSWORD']
                    config.registration.skip = param(p, :skip_subscription)
                    config.registration.name = name
                    # config.registration.unregister_on_halt = false
                end
            end

            # Set VM parameters
            node.vm.provider 'virtualbox' do |vb|

                puts node.vm.hostname
                vagrant_registration(node.vm.hostname, config)