Skip to content

Instantly share code, notes, and snippets.

@lavagetto lavagetto/facts_export.sh Secret
Created Aug 28, 2015

Embed
What would you like to do?
Clean up puppet facts and create an archive of them
#!/bin/sh
sudo cp -r /var/lib/puppet/yaml yaml
sudo chown -R ${USER}. yaml
find yaml -type f -name "*.yaml" | xargs -n1 perl -i"" -pe 's/^(\s*uniqueid:).*$/$1 "400a1000"/; s/^(\s*boardserialnumber:).*$/$1 "..CN123456AB00AA."/; s/^(\s*serialnumber:).*$/$1 AB12BP0/'
tar -cJvf puppet-facts.tar.xz yaml
rm -rf yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.