Puppet: add string to /etc/hosts

add to /etc/puppet/manifests/site.pp

1
2
3
4
5
6
7
8
9
10
11
class hosts {
  host { 'host1.local':
    ensure => 'present',
    target => '/etc/hosts',
    ip => '192.168.192.31'
  }
}

node default {
  include hosts
}

It'll add string:

192.168.192.31 host1.local to /etc/hosts