Puppet Class: hostname::darwin
- Defined in:
- manifests/darwin.pp
Overview
Definitions for Macs
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'manifests/darwin.pp', line 3
class hostname::darwin {
$local_hostname = $hostname::hostname
$local_domain = $hostname::domain
exec { 'set computername':
command => "/usr/sbin/scutil --set ComputerName ${local_hostname}",
unless => "test `scutil --get ComputerName` == '${local_hostname}'",
require => Sudoers::Allowed_Command['hostname_scutil'],
}
exec { 'set hostname':
command => "/usr/sbin/scutil --set HostName ${local_hostname}",
unless => "test `scutil --get HostName` == '${local_hostname}'",
require => Sudoers::Allowed_Command['hostname_scutil'],
}
exec { 'set localhostname':
command => "/usr/sbin/scutil --set LocalHostName ${local_hostname}",
unless => "test `scutil --get LocalHostName` == '${local_hostname}'",
require => Sudoers::Allowed_Command['hostname_scutil'],
}
}
|