Sha256: 9cdbe09cdb912946eb3ba4f4968725de726d9b2cbd01bcf524c64ecb7ad56917

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

module VagrantPlugins
  module GuestOmniOS
    module Cap
      class ChangeHostName
        def self.change_host_name(machine, name)
          su_cmd = machine.config.solaris.suexec_cmd

          # Only do this if the hostname is not already set
          if !machine.communicate.test("#{su_cmd} hostname | grep '#{name}'")
            machine.communicate.execute("#{su_cmd} sh -c \"echo '#{name}' > /etc/nodename\"")
            machine.communicate.execute("#{su_cmd} hostname #{name}")
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/plugins/guests/omnios/cap/change_host_name.rb