I'm setting up a new server with Puppet to manage the native OS and many jails. I've been having horrible problems trying to automate the management of key/value pairs for rc, sysctl, and loader. I'm wondering if anyone had advice or had been successful managing these key files.
I started with https://web.archive.org/web/2015011...uppetlabs.com/projects/1/wiki/Puppet_Free_Bsd .
First I tried using the shell_config type using grep/sed/etc. That had edge cases for editing keys and values. I either had duplicate keys or a problem with a specific text match of key+value required to manage the setting.
Next I tried the augeas shell_config using the Shellvars lens. This fails on /etc/sysctl.conf, and I've had problems with extra quotes.
Tried using the augeas Sysctl lens, and that adds spaces around equals signs (linuxism?), breaking all three file formats. Augeus is completely undocumented, and I have little faith in it now.
Puppet Forge has incomplete modules which use the same shell_config code. No help there.
Both /etc/rc.conf and /boot/loader.conf have options to use a ".d" directory. Unfortunately /etc/rc.conf.d/ only loads files by service name, so I can't place settings in one file at a time to load globally.
The new sysrc command could set or remove rc values nicely, but fails on sysctl and loader.conf due to .'s in key names. There seems to be no corresponding tools for sysctl.conf or loader.conf.
I also haven't seen a command to validate that rc/sysctl/loader file content.
It shouldn't be this hard to manage persistent key/value pairs.
I started with https://web.archive.org/web/2015011...uppetlabs.com/projects/1/wiki/Puppet_Free_Bsd .
First I tried using the shell_config type using grep/sed/etc. That had edge cases for editing keys and values. I either had duplicate keys or a problem with a specific text match of key+value required to manage the setting.
Next I tried the augeas shell_config using the Shellvars lens. This fails on /etc/sysctl.conf, and I've had problems with extra quotes.
Tried using the augeas Sysctl lens, and that adds spaces around equals signs (linuxism?), breaking all three file formats. Augeus is completely undocumented, and I have little faith in it now.
Puppet Forge has incomplete modules which use the same shell_config code. No help there.
Both /etc/rc.conf and /boot/loader.conf have options to use a ".d" directory. Unfortunately /etc/rc.conf.d/ only loads files by service name, so I can't place settings in one file at a time to load globally.
The new sysrc command could set or remove rc values nicely, but fails on sysctl and loader.conf due to .'s in key names. There seems to be no corresponding tools for sysctl.conf or loader.conf.
I also haven't seen a command to validate that rc/sysctl/loader file content.
It shouldn't be this hard to manage persistent key/value pairs.