Sha256: 44b5dcc1dc9cd72c2720698f6c4e4abef133dfb97518f92c95be0ae4ef2896ff

Contents?: true

Size: 376 Bytes

Versions: 6

Compression:

Stored size: 376 Bytes

Contents

module VagrantPlugins
  module GuestPhoton
    module Cap
      class ChangeHostName
        def self.change_host_name(machine, name)
          machine.communicate.tap do |comm|
            unless comm.test("sudo hostname --fqdn | grep '#{name}'")
              comm.sudo("hostname #{name.split('.')[0]}")
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 3 versions & 2 rubygems

Version Path
vagrant-unbundled-1.8.1.2 plugins/guests/photon/cap/change_host_name.rb
vagrant-unbundled-1.8.1.1 plugins/guests/photon/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/plugins/guests/photon/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/plugins/guests/photon/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/plugins/guests/photon/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/plugins/guests/photon/cap/change_host_name.rb