ncsa / xcat-tools

Useful tools for xCAT
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

backup & restore puppet cert dir and puppet config file #14

Closed andylytical closed 4 years ago

andylytical commented 4 years ago

Backup & restore the puppet.conf file will allow a node to retain it's original puppet server setting (to go along with the ca.pem in the ssl cert dir). This also will preclude necessarily changing the "puppetmaster" setting in the xcat master "site" table when re-building a node.

This can be accomplished by saving a (or multiple) tgz file(s) on the xcat master, and then restoring them using the -P flag (retain leading slash) when untarring them on the re-build target node.

Ensure puppet_configure will "set_server" only if the conf file was not restored from backup (ie: when this is a new node). This can be accomplished by checking the mtime on puppet's config file, which will be very new (less than 1 hour old) when restored from the tgz file. If conf file is the original from the puppet rpm, the mtime will be much older (days, weeks, or months).