Skip to content

[FEATURE REQUEST] Ignore service state actions when in chroot #62446

Closed
@nicholasmhughes

Description

Is your feature request related to a problem? Please describe.
We have a common workflow where we need to manage services, but only when Salt is not running in a chroot. Unless we gate the state blocks with Jinja, it runs and fails since the chroot does not have enough access to perform the action.

Describe the solution you'd like
Simple parameter for every state module function which will ignore actions while in chroot, but act normally when outside of it.

Describe alternatives you've considered
Wrapper Jinja around every service state block (or macros):

{% if grains.get("virtual_subtype") != "chroot" -%}
manage_service:
  service.running:
    - name: service_name

{% endif -%}

Additional context
Somewhat related to issue #38751, although we don't want to take action with this workflow... whereas the solution to that issue would allow some actions to be be taken from within the chroot if allowed.

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.

Metadata

Labels

Featurenew functionality including changes to functionality and code refactors, etc.State-Module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions