A collection of task oriented solutions in Puppet

 

Remove a host entry

Challenge

Remove a host entry

Solution

class remove_host_entry {

  host { 'syslog':
    ensure => 'absent',
  }

  host { 'ntpserver.example.com':
    ensure => 'absent',
  }

}

Explanation

You've found an old host entry that you no longer needed. Whether the old record is now in DNS or should no longer exist puppet makes removing it simple.

Removing puppet managed host entries is as easy as the code snippet illustrates. A simple ensure => 'absent' is all you need.

See also