I'm using Ansible, not Chef, but the concept should be the same - and I'm currently dealing with the exact same problem myself. What seems to be working for me so far is:
Spin up a Splunk instance somewhere that sets all of your pass4SymmKey stuff to the encrypted version of what you want
Take the resulting encrypted password and use it in your recipes/templates/whatever
Add $SPLUNK_HOME/etc/auth/splunk.secret to the list of files you manage with Chef, so that all instances of Splunk use the same secret to create passwords.
Now when splunk starts up and checks to see if it can find an encrypted password, it'll pass
I've not tested this for everything yet, but my local dev environment that I'm using to build my Ansible playbooks has an operational cluster using this method - I've only actually tested the theory on the cluster key in the last few minutes, but will get on to the rest of it.
You'll obviously want to protect this secret - I use ansible-vault, but I guess encrypted data bags are probably your version.
It's very early days in my testing, but I can update here with more detail if people are interested - or somebody can update me with the wall they know I'm going to hit but haven't yet 🙂
Cheers.
... View more