Skip to content

Refactoring proposal: separate top-states and module-states #125

@3nprob

Description

@3nprob

Commitment

I confirm that I have read the following resources:

Current problem (if any)

As we add more states and appvms, it quickly becomes difficult to keep track of all the directories accumulating under salt/. Especially if actually doing the whole "never do manual changes; do all your operations declaratively".

Some are primarily used like mixins/roles, some map 1-to-1 to individual appvms, some serve both purposes.

Proposed solution

There are likely salt patterns here I'm not familiar with yet but roughly it seems to make sense to separate top files (and maybe some "leaf-state" files?) to a separate directory from composable states.

For example (names just placeholders and I'm not confident exactly where to best make the cut):

salt/
salt/top/
salt/top/dev/
salt/top/dev/clone.sls
salt/top/dev/create.sls
salt/top/dev/init.sls
salt/top/dev/*.top
salt/mod/
salt/mod/dev/{the rest}.sls

# or
salt/mod/python/install-python-tools.sls
salt/mod/x11/install-terminal.sls
salt/utils/tools/common/home-cleanup.sls

The reasoning being that the ones under top define the individual deployments while states under mod are used to compose those.

The value to a user, and who that user might be

Easier to keep track of the local stack as we mess around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions