Big changes in the code were: - Replaced `create_...
# puppet
g
Big changes in the code were: • Replaced
create_resources
of defined types used in Puppet 3 with
.each
loops • Replaced ruby function that shelled out to ssh-keygen to determine the content of a file resource with having that data as another key in an already used hiera hash. There are 7,800+ of these file resources • Replaced a
mkdir -p
of two parent directories of a file resource with
ensure_resource('file', [$dir_1, $dir_2], {stuff here})
• Those two dirs were previously determined by using an inline template to find each ones name: the first char of a hostname and the first two chars of a hostname. Those were replaced with the native substring bits of String. • A password file for ProFTP was previously managed as an exec that had a test using grep for the needed data and then an echo to append to the file if not found. This file is now a
concat
resource and there are 7,800+
concat::fragments
populating it now (same number of fragments as exec's with test/echo) • an erb template was converted to epp. the file produces a single line of text that is not long at all • The hash mentioned earlier used to be passed into
create_resources
to create 7,800+ rsa pubkey files. That same hash is now processed with
$actual_pubkey_hash.each |$name, $params| {}
that passes the params as a splat to a file resource:
"${pub_dir}/${name}.pub.pem":
• Puppet types were added to all the things • a couple of params were converted to Sensitive •
asert_type()
was added in a few places to validate input