Ask Your Question
1

How do I remove a contact::fragment for a node that no longer exists?

asked 2014-01-20 06:26:38 -0500

robrwo gravatar image

We use munin to monitor our machines. Each machine "registers" itself as a munin node to the puppetmaster using a concat::fragment, e.g.

$order = fqdn_rand(1000,500)

@@concat::fragment { "${::fqdn}_munin":
  target  => '/etc/munin/munin.conf',
  content => template('munin/munin.erb'),
  tag     => 'munin,
  order   => $order,
}

```

We've turned one of the machines off, permanently, but the puppetmaster remembers the concat::fragment so ensures that it's added.

How do we tell puppet that the node is removed, and to delete all such fragments (and any other information about the node)?

edit retag flag offensive close merge delete

Comments

Note: we've removed the node in the dashboard., but the concat::fragment is still instantiated.

robrwo gravatar imagerobrwo ( 2014-01-20 06:35:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-01-20 09:16:44 -0500

robrwo gravatar image

Answer is in http://docs.puppetlabs.com/puppetdb/latest/maintainandtune.html#deactivate-decommissioned-nodes - run

  puppet node deactivate fqdn-of-node.example.com
edit flag offensive delete link more

Comments

Erm. Are you sure about that ? puppet node deactivate prevents exported resources being realised from the point you deactivate the note. The file that the concat::fragment creates will have ...(more)

jonuwz gravatar imagejonuwz ( 2014-01-20 12:50:15 -0500 )edit

@jonuwz: we can't alter the exported fragment to be absent when the server is gone. However, deactivating the node did the trick. The fragment went away. Whether this is ...(more)

robrwo gravatar imagerobrwo ( 2014-01-22 05:57:27 -0500 )edit

This is correct. deactivate should be used for decommissioning nodes. The "puppet node clean --unexport" is purely to work around cases where a purge is not possible (resource doesn't ...(more)

ken gravatar imageken ( 2014-01-22 08:08:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-01-20 06:26:38 -0500

Seen: 320 times

Last updated: Jan 20 '14