Sha256: 5bdc56ac1147f25cb2707fd868536e6a0e54db7de85b3df2b69571d30478ea24

Contents?: true

Size: 544 Bytes

Versions: 16

Compression:

Stored size: 544 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

16 entries across 13 versions & 6 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/plugins/guests/omnios/cap/change_host_name.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/plugins/guests/omnios/cap/change_host_name.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/plugins/guests/omnios/cap/change_host_name.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/plugins/guests/omnios/cap/change_host_name.rb
vagrant-unbundled-1.8.1.2 plugins/guests/omnios/cap/change_host_name.rb
vagrant-unbundled-1.8.1.1 plugins/guests/omnios/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/plugins/guests/omnios/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/plugins/guests/omnios/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/plugins/guests/omnios/cap/change_host_name.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/plugins/guests/omnios/cap/change_host_name.rb
vagrant-guest-omnios-0.3.0 lib/vagrant-guest-omnios/cap/change_host_name.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/plugins/guests/omnios/cap/change_host_name.rb
tnargav-1.3.6 plugins/guests/omnios/cap/change_host_name.rb
tnargav-1.3.3 plugins/guests/omnios/cap/change_host_name.rb
tnargav-1.2.3 plugins/guests/omnios/cap/change_host_name.rb
vagrant-guest-omnios-0.0.1 lib/vagrant-guest-omnios/cap/change_host_name.rb