Sha256: 96e1b0263b9dd5437092b7c388de282925c271037837f6eac60a4635790f6300

Contents?: true

Size: 1022 Bytes

Versions: 37

Compression:

Stored size: 1022 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)
          su_cmd = machine.config.solaris11.suexec_cmd

          # 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.execute("#{su_cmd} /usr/sbin/svccfg -s system/identity:node setprop config/nodename=\"#{name}\"")
            machine.communicate.execute("#{su_cmd} /usr/sbin/svccfg -s system/identity:node setprop config/loopback=\"#{name}\"")
            machine.communicate.execute("#{su_cmd} /usr/sbin/svccfg -s system/identity:node refresh ")
            machine.communicate.execute("#{su_cmd} /usr/sbin/svcadm restart system/identity:node ")
          end
        end
      end
    end
  end
end

Version data entries

37 entries across 33 versions & 5 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/guests/solaris11/cap/change_host_name.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.3.3.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.3.2.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.19.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.18.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.16.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.14.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.10.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.9.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.8.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.7.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.6.2 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.6.1 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.6.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.5.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.4.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.3.0 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.2.2.0 plugins/guests/solaris11/cap/change_host_name.rb