saltstack / saltstack/salt

[FEATURE REQUEST] Don't attempt to run disabled startup states

Open
#68,010 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Is your feature request related to a problem? Please describe.
Right now, if you use startup states and have those states disabled with state.disable, the configured state function will attempt to run but will instantly fail.
If you monitor your state failures or do some orchestration that requires that the minion restart, (either directly or indirectly), and then run some additional state; then this will become an annoyance.

Describe the solution you'd like
I would suggest changing the MinionManager._state_run function to do a check against the state_runs_disabled grain to see if the state file is disabled, if so log that the startup state is disabled and quietly ignore running the startup state.

Describe alternatives you've considered
A lot of ugly fixes to user code.

Additional context
Not really

Please Note
If this feature request would be considered a substantial change or addition, this should go through a SEP process here https://github.com/saltstack/salt-enhancement-proposals, instead of a feature request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MinionManager._state_run and inspect how the state_runs_disabled grain is checked during startup-state execution. Confirm how disabled state files currently fail and where startup-state logging is performed. Done means disabled startup states are skipped, a disabled-state message is logged, and they no longer produce a state failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.