| The hosts file implementation can deal with both IPv4 and IPv6:
kris.bosland@kris:puppet % cat ../tmp/pup-9480/apply.pp |
host { 'dummy.ipv.4': |
ensure => 'present', |
ip => '192.168.2.1', |
target => '/Users/kris.bosland/work/tmp/pup-9480/hosts', |
} |
host { 'dummy.ipv.6': |
ensure => 'present', |
ip => '::2', |
target => '/Users/kris.bosland/work/tmp/pup-9480/hosts', |
} |
kris.bosland@kris:puppet % bx puppet apply ../tmp/pup-9480/apply.pp Notice: Compiled catalog for kris.bosland-c02kf9eafft1 in environment production in 0.07 seconds |
Notice: Applied catalog in 0.01 seconds |
kris.bosland@kris:puppet % cat ../tmp/pup-9480/hosts |
# HEADER: This file was autogenerated at 2019-08-26 10:53:44 -0700 |
# HEADER: This file was autogenerated at 2019-08-26 10:53:44 -0700 |
# HEADER: by puppet. While it can still be managed manually, it |
# HEADER: is definitely not recommended. |
255.255.255.255 broadcasthost |
127.0.0.1 localhost |
::2 dummy.ipv.6 |
127.0.0.1 puppet.delivery.puppetlabs.net |
127.0.0.1 kubernetes.docker.internal |
192.168.2.1 dummy.ipv.4 |
kris.bosland@kris:puppet % |
However, with the current host resource model, only one IP can be set for each host, so you cannot set both IPv4 and IPv6 addresses for the same hostname. |