Sha256: 973143f61f058a77ea245531c0fef1ab388ad541414e4177c7ed8b8c7e2c5b3b

Contents?: true

Size: 914 Bytes

Versions: 2

Compression:

Stored size: 914 Bytes

Contents

# A general Vagrant system implementation for "solaris 11".
#
# Contributed by Jan Thomas Moldung <janth@moldung.no>

module VagrantPlugins
  module GuestSolaris11
    module Cap
      class ChangeHostName
        def self.change_host_name(machine, name)
          # Only do this if the hostname is not already set
          if !machine.communicate.test("/usr/sbin/svccfg -s system/identity:node listprop config/nodename | /usr/bin/grep '#{name}'")
            machine.communicate.sudo("/usr/sbin/svccfg -s system/identity:node setprop config/nodename=\"#{name}\"")
            machine.communicate.sudo("/usr/sbin/svccfg -s system/identity:node setprop config/loopback=\"#{name}\"")
            machine.communicate.sudo("/usr/sbin/svccfg -s system/identity:node refresh ")
            machine.communicate.sudo("/usr/sbin/svcadm restart system/identity:node ")
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-guests-solaris11-0.0.1a lib/vagrant-guests-solaris11/cap/change_host_name.rb
vagrant-guests-solaris11-0.0.1.dev lib/vagrant-guests-solaris11/cap/change_host_name.rb