Skip to content

Instantly share code, notes, and snippets.

@elyscape elyscape/1-hostfile
Created Jan 22, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.