Skip to content

Instantly share code, notes, and snippets.

@elyscape
Created January 22, 2015 22:31
Show Gist options
  • Save elyscape/bbf720a13e8d236ca365 to your computer and use it in GitHub Desktop.
Save elyscape/bbf720a13e8d236ca365 to your computer and use it in GitHub Desktop.
Puppet's flawed implementation of the host type
127.0.0.1 localhost.localdomain localhost.localdomain localhost4 localhost4.localdomain4 localhost puppet-eli
::1 localhost.localdomain localhost.localdomain localhost6 localhost6.localdomain6 localhost puppet-eli
host { 'localhost.localdomain':
ensure => 'present',
host_aliases => ['localhost.localdomain', 'localhost4', 'localhost4.localdomain4', 'localhost', 'puppet-eli'],
ip => '127.0.0.1',
target => '/etc/hosts',
}
# output of `puppet resource host` when 1-hostfile is /etc/hosts
# notice that there is no entry for ::1 even though the domains differ (e.g. localhost6)
127.0.0.1 localhost.localdomain localhost.localdomain localhost4 localhost4.localdomain4 localhost puppet-eli
::1 test localhost.localdomain localhost.localdomain localhost6 localhost6.localdomain6 localhost puppet-eli
host { 'localhost.localdomain':
ensure => 'present',
host_aliases => ['localhost.localdomain', 'localhost4', 'localhost4.localdomain4', 'localhost', 'puppet-eli'],
ip => '127.0.0.1',
target => '/etc/hosts',
}
host { 'test':
ensure => 'present',
host_aliases => ['localhost.localdomain', 'localhost.localdomain', 'localhost6', 'localhost6.localdomain6', 'localhost', 'puppet-eli'],
ip => '::1',
target => '/etc/hosts',
}
# output of `puppet resource host` when 3-hostfile is /etc/hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment