splunk / splunk/splunk-platform-automator
Make spa deploy idempotent after successful convergence
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 137
- Forks
- 51
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 14
Description
Summary
A second spa deploy against an unchanged environment should finish green: no changed task-host results, no Splunk restart, no deploy-server reload, no cluster-bundle push.
Today compact progress still reports changed on rerun. That is playbook idempotence, not the progress renderer. Observed on env my-lab after a successful site was already up (2026-09-18T145100+0200-deploy JSONL): Splunk install changed 16/259, Baseconfig apps changed 5/172 (the stored transcript had more changed results than the headline because baseconfig continues after that line commits).
Acceptance
- Two consecutive successful
spa deploy --yesruns with unchangedsplunk_config.yml. - Second run: compact line ends
ok(green) for every group; JSONL has zerohost_resultwithstatus: changed. systemctl daemon-reloadruns only when a unit file actually changed.- Login-page
web.conflogin_contentis byte-stable across reruns. - Baseconfig
local.metaand generated.confstay unchanged on the second pass (bothetc/appsandetc/deployment-appscopies oforg_all_forwarder_outputs). - No Splunk restart,
reload deploy-server, or cluster-bundle apply without an upstream change. - Local test: run the relevant roles twice (or a fixture playbook) and fail if the second recap has
changed > 0.
Known always-changed tasks (from JSONL)
Splunk install
splunk_software : Commit changes to systemctl—ansible.builtin.command: systemctl daemon-reloadinadd_disable_thp_service.ymlandupdate_splunk_service.yml(always changed; two times per Enterprise host).splunk_software : Add user and roles info to login page—ini_fileonweb.conflogin_contentinui_config.yml. Value includessplunk_rolesfromgroup_vars/all/dynamic.yml; group iteration order is not sorted, so the string can change every run and notifyRestart splunk.splunk_common : Restart splunk— follow-on of the login-page notify.
Baseconfig
org_all_forwarder_outputsis applied twice on the DS host by design (etc/appsthenetc/deployment-appsindeployment_server/tasks/main.yml). Two copies are expected; both must be stable on rerun.- Still changing on the second pass:
copy local.meta(nochecksum/force: false—install_app.yml),setting defaultGroup value,setting ssl vars in tcpout stanza for clustered indexers(ini_filewithoutno_extra_spaces),Define org_all_forwarder_outputs server class clients, plus indexerorg_cluster_indexer_basecopy local.meta/ SSL inputs. - Follow-on:
Reload deploy-serverandRestart splunk.
The JSONL names the tasks; it does not store before/after diffs. Pickup should compare rendered files on a live rerun.
Implementation hints
- Gate
daemon-reloadon a notify from unit-file copy/ini tasks, orchanged_when: falseif a reload is required but must not count as a change. - Sort
splunk_roles(and any other login-page fragments) before writinglogin_content. - Make
copy local.metaandcommunity.general.ini_filecompare equal when content already matches (checksum,no_extra_spaces, explicit mode/owner). - Do not mark
commandhandlers (reload deploy-server) changed when they only ran because a non-idempotent task fired.
Related
- Env-dir logs / compact progress: #71
- ROADMAP.md Lifecycle
Pickup-ready enhancement. Skills and agents call spa only. Never print secrets.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the named tasks in add_disable_thp_service.yml, update_splunk_service.yml, ui_config.yml, install_app.yml, and deployment_server/tasks/main.yml, then inspect group_vars/all/dynamic.yml for login-page ordering. Run the relevant roles twice, or use a fixture playbook, and compare rendered files and the second recap. Done means the second run has zero changed host results and triggers no unnecessary reloads, restarts, or bundle applies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ansible
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100