I'm sure we've all seen this message from time to time when using puppet with exported resources:
Error 400 on SERVER: Exported resource Sshkey[foo] cannot override local resource on node bar.example.com
It's actually pretty easy to fix. Simply delete the exported resource for node foo.
Assuming you are using MySQL for your DB, something like this will do the trick:
mysql -e "delete from resources where restype like 'sshkey' and exported=1 and host_id = (select id from hosts where name 'foo')" puppet
I use puppet to manage the configuration of the machines I manage. So far, I've been rolling out new resources to machines but recently I've wanted to remove resources from machines. Here's how I modified my cron classes so I could remove cron jobs as well as create them.
I use puppet to distribute my sshd configuration, including pre-generated ssh certificates.
Here's how I bulk create certificates for a bunch of new nodes named b001-b034:
for n in $(seq -w 1 34); do
ssh-keygen -q -t rsa -f b0$n -C '' -N ''