Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noop state for co-ordinating requires / modularizing includes #11893

Closed
ahammond opened this issue Apr 9, 2014 · 11 comments
Closed

noop state for co-ordinating requires / modularizing includes #11893

ahammond opened this issue Apr 9, 2014 · 11 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. help-wanted Community help is needed to resolve this
Milestone

Comments

@ahammond
Copy link
Contributor

ahammond commented Apr 9, 2014

Please create a noop.noop state that can be used to provide a name to require for formulae that are including other formulae.

Example:

foo.sls

foo:
  pkg.installed

foo_complete:
  noop.noop

{% for x in biglist %}
foo_file_{{ x }}:
  file.managed:
    - require:
      - pkg: foo
    - require_in:
      - noop: foo_complete
{% endfor %}

bar.sls

include:
  - foo

bar:
  pkg.installed

bar_config:
  file.managed:
    - require:
      - pkg: bar
      - noop: foo_complete

This allows includes to be nice and clean and modular. Thoughts?

@whiteinge whiteinge added this to the Approved for future release milestone Apr 9, 2014
@whiteinge
Copy link
Contributor

Good stuff! (And low-hanging fruit.) Tagged for a future release.

@kiorky
Copy link
Contributor

kiorky commented Apr 12, 2014

@whiteinge i can make a PR for putting that module in salt core if it has an interrest.

@whiteinge
Copy link
Contributor

@kiorky yes, please. :)

@basepi
Copy link
Contributor

basepi commented Apr 17, 2014

Isn't this already implemented, in the test state? You have functions such as test.succeed_without_changes, or test.succeed_with_changes, or even test.configurable_test_state which allows you to just define all the pieces of the return for that state.

@whiteinge
Copy link
Contributor

What undocumented madness is this?!

@whiteinge
Copy link
Contributor

@kiorky I added the test state module to the docs in 138cf6f.

@ahammond, @kiorky does that module look sufficient to satisfy this ticket?

@whiteinge
Copy link
Contributor

Docs were a little slow to build; now they're up. Relevant docs here:

http://docs.saltstack.com/en/latest/ref/states/all/salt.states.test.html

@ahammond
Copy link
Contributor Author

Looks like it would do the job. I'm running 2014.1.0 and it doesn't appear to be in there. Next release?

@whiteinge
Copy link
Contributor

Ah. Indeed not. I just added version docs (91935da).

To use it now you can pull test.py off GitHub and put it in your /srv/salt/_states directory.

@basepi
Copy link
Contributor

basepi commented Apr 21, 2014

Heh, didn't realize they were that new, and undocumented to boot! I was just looking in the source. =P

Anyway, looks like we're documented and it solves the original case, so I'm going to close this.

@basepi basepi closed this as completed Apr 21, 2014
kwakwaversal added a commit to kwakwaversal/postgres-formula that referenced this issue Mar 22, 2017
When the properties bake_image and postgresconf are set, the
postgresconf expects postgresql-running to exist. Adding an empty
postgresql-running state should fix this, and any other future
states that require/expect this specific state.

I added an echo command due to saltstack/salt#11893
kwakwaversal added a commit to kwakwaversal/postgres-formula that referenced this issue Mar 22, 2017
When the properties bake_image and postgresconf are set, the
postgresconf expects postgresql-running to exist. Adding an empty
postgresql-running state should fix this, and any other future
states that require/expect this specific state.

I added an echo command due to saltstack/salt#11893
kwakwaversal added a commit to kwakwaversal/postgres-formula that referenced this issue Mar 22, 2017
When the properties bake_image and postgresconf are set, the
postgresconf expects postgresql-running to exist. Adding an empty
postgresql-running state should fix this, and any other future
states that require/expect this specific state.

I added an echo command due to saltstack/salt#11893
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. help-wanted Community help is needed to resolve this
Projects
None yet
Development

No branches or pull requests

4 participants