Revision b64aaf5c
Added by Ohad Levy over 12 years ago
- ID b64aaf5c40868d690beaca7e58f07d93b83eadba
app/models/host.rb | ||
---|---|---|
def set_hostgroup_defaults
|
||
return unless hostgroup
|
||
assign_hostgroup_attributes(%w{environment domain puppetmaster_name puppetproxy})
|
||
if new_record? or managed?
|
||
if SETTINGS[:unattended]
|
||
assign_hostgroup_attributes(%w{operatingsystem medium architecture ptable root_pass subnet})
|
||
self.ip ||= subnet.unused_ip if subnet
|
||
end
|
||
if SETTINGS[:unattended] and (new_record? or managed?)
|
||
assign_hostgroup_attributes(%w{operatingsystem medium architecture ptable root_pass subnet})
|
||
self.ip ||= subnet.unused_ip if subnet
|
||
assign_hostgroup_attributes(Vm::PROPERTIES) if hostgroup.hypervisor?
|
||
end
|
||
end
|
Also available in: Unified diff
fixes #1147 - fail to update hosts when running with unattended mode disable