Sha256: 7dc48b14161ce3db905cde66fd0294ff8c38f1eeb477639d19d963462aa72f12
Contents?: true
Size: 590 Bytes
Versions: 6
Compression:
Stored size: 590 Bytes
Contents
module VagrantPlugins module GuestSUSE module Cap class ChangeHostName def self.change_host_name(machine, name) machine.communicate.tap do |comm| # Only do this if the hostname is not already set if !comm.test("sudo hostname | grep '#{name}'") comm.sudo("echo #{name} > /etc/HOSTNAME") comm.sudo("hostname #{name}") comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts") end end end end end end end
Version data entries
6 entries across 3 versions & 2 rubygems