Add a host entry with Puppet

Add an entry to your local systems equivalent to /etc/hosts

1

Votes

class host_entries {

  # create a simple hostname and ip host entry
  host { 'syslog':
    ip => '10.10.10.10',
  }

  # create a fully qualified full host entry with an alias
  host { 'ntpserver.example.com':
    ip           => '10.100.10.50',
    host_aliases => 'timeserver',
  }

  # host entry with multiple aliases
  host { 'dashboard':
    ip           => '10.120.100.111',
    host_aliases => [ 'nagios', 'munin' ],
  }

}

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png