Sha256: 6e2b66b0ae9f799f4ee27efb3ac3617c1d83799b42afc297ec613ee86392f018

Contents?: true

Size: 1.16 KB

Versions: 32

Compression:

Stored size: 1.16 KB

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} sh -c \"echo '#{name}' > /etc/nodename\"")
            #machine.communicate.execute("#{su_cmd} uname -S #{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

32 entries across 29 versions & 7 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-2.0.0.1 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-1.9.8.1 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-1.9.7.1 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-1.9.5.1 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-1.9.1.1 plugins/guests/solaris11/cap/change_host_name.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-1.8.5.2 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-1.8.5.1 plugins/guests/solaris11/cap/change_host_name.rb
vagrant-unbundled-1.8.4.2 plugins/guests/solaris11/cap/change_host_name.rb