If you have git, you can do is create a simple python that do git pull the app into shcluster, and also do an apply after the pull. There are git module out there you can use. Here is a quick simple one that I wrote up awhile back to do the cluster apply.
Something like this ---
...
def dirsWalkSHCluster():
dirwalk = os.listdir( shcluster_Path )
#print dirwalk
print "Updating Search Head Cluster apps"
for file in dirwalk:
if not file.startswith('.'):
if not file.startswith('README'):
if not file.startswith('splunk_admin_app'):
if not file.startswith('sentinel.txt'):
joinpath = os.path.join(shcluster_Path, file)
os.chdir( joinpath )
## Git Process
git_process = subprocess.Popen(["git", "pull", "origin", "master"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
processOutput = git_process.communicate()[0]
print "datetime="+now + " " + " " + "gitrepo="+file + " " + "message="+processOutput
## Apply Search Head Cluster changes
splunkCommand = ("sudo /opt/splunk/bin/./splunk apply shcluster-bundle --answer-yes -target https://%s:8089 -auth git_deploy:git_deploy_pw") %(searchhead)
splunkOutput = subprocess.Popen(splunkCommand, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
msgOut = splunkOutput.communicate()[0]
print "datetime="+now + " " + "command_run=Reload SHCluster" + " " + " " + "message=" +msgOut
run the script as splunk user, in sudoers file only allow splunk to run splunk command and you can specific with command. You can probably obscure the pw too.
... View more