FAQ
Suppose I have a state in SLS file like this:

dummy_state:
     cmd.run:
         - name: echo nothing


If I run the state, the output will look something like this:

salt 'minion_id' state.sls dummy
minion_id:
----------
           ID: dummy_state
     Function: cmd.run
         Name: echo nothing
       Result: True
      Comment: Command "echo nothing" run
      Changes:
               ----------
               pid:
                   28198
               retcode:
                   0
               stderr:

               stdout:
                   nothing

Summary
------------
Succeeded: 1
Failed: 0
------------
Total: 1



Note the Salt-generated `Comment` key in the output. It definitively
clarifies what's going on, but it is not controlled by user (author of SLS).

It doesn't solve any technical issue, but it would be nice to have a
possibility to add some description (i.e. `desc` key) which will become
part of resulted output. For example:


dummy_state:
     cmd.run:

         - desc: run dummy command without side effect

         - name: echo nothing


The output of such state could be like this:

salt 'minion_id' state.sls dummy
minion_id:
----------
           ID: dummy_state
     Function: cmd.run
         Name: echo nothing
       Result: True

  Description: run dummy command without side effect

      Comment: Command "echo nothing" run
      Changes:
               ----------
               pid:
                   28198
               retcode:
                   0
               stderr:

               stdout:
                   nothing

Summary
------------
Succeeded: 1
Failed: 0
------------
Total: 1


Simple need and simple implementation.

There is always a way to look up state id in the SLS files and figure out
what's going on.
However, this simple feature makes reports save-able and read-able for
documenting/auditing point of view.
For example, to provide hints about tests run through Salt (i.e. in CI
platform), or appendix for some formal documents about site deployments
between vendor and customer, etc.

Any comments before I submit a feature request?


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Joel Whitehouse at Jul 30, 2014 at 4:20 pm
    It would make sense to have the attribute be something longer than
    "desc". Perhaps "salt comment"?

    dummy_state:
        cmd.run:
          - name: echo nothing
          - salt comment: This comment replaces salt's auto-generated
    output.

    A salt state may need to pass a description or a comment on to some
    other module in the future because the words 'description', 'comment',
    and even 'salt' have meanings in other domains besides the enforcement
    of salt states. By choosing a longer key we reduce the likelihood of
    collision with one of these other contexts.

    On 2014-07-30 11:09, [email protected] wrote:
    Suppose I have a state in SLS file like this:
    dummy_state:
    cmd.run:
    - name: echo nothing
    If I run the state, the output will look something like this:
    salt 'minion_id' state.sls dummy

    minion_id:

    ----------

    ID: dummy_state

    Function: cmd.run

    Name: echo nothing

    Result: True

    Comment: Command "echo nothing" run

    Changes:

    ----------

    pid:

    28198

    retcode:



    stderr:

    stdout:

    nothing

    Summary

    ------------

    Succeeded: 1

    Failed: 0

    ------------

    Total: 1
    Note the Salt-generated `Comment` key in the output. It definitively
    clarifies what's going on, but it is not controlled by user (author
    of
    SLS).

    It doesn't solve any technical issue, but it would be nice to have a
    possibility to add some description (i.e. `desc` key) which will
    become part of resulted output. For example:

    dummy_state:
    cmd.run: - name: echo nothing

    The output of such state could be like this:

    salt 'minion_id' state.sls dummy

    minion_id:

    ----------

    ID: dummy_state

    Function: cmd.run

    Name: echo nothing

    Result: True
    Description: run dummy command without side effect

    Comment: Command "echo nothing" run

    Changes:

    ----------

    pid:

    28198
    nothing

    Summary

    ------------
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/d/optout.
  • Alexey Pakseykin at Jul 30, 2014 at 4:48 pm
    Hi Joel, I agree - keys can be anything more specific for SLS file. But
    feature is not affected by these details.

    By the way, when both "Description" and "Comment" are used in the output, I
    also find it semantically more appropriate to swap the source of their
    strings:

    "Comment" = Human-provided comment
    "Description" = Salt-generated auto description

    It may break some scripts hooked on currently used "Comment" key though.

    On Thu, Jul 31, 2014 at 12:20 AM, Joel Whitehouse wrote:

    It would make sense to have the attribute be something longer than "desc".
    Perhaps "salt comment"?


    dummy_state:
    cmd.run:
    - name: echo nothing
    - salt comment: This comment replaces salt's auto-generated output.

    A salt state may need to pass a description or a comment on to some other
    module in the future because the words 'description', 'comment', and even
    'salt' have meanings in other domains besides the enforcement of salt
    states. By choosing a longer key we reduce the likelihood of collision
    with one of these other contexts.


    On 2014-07-30 11:09, [email protected] wrote:

    Suppose I have a state in SLS file like this:

    dummy_state:
    cmd.run:
    - name: echo nothing
    If I run the state, the output will look something like this:

    salt 'minion_id' state.sls dummy
    minion_id:

    ----------

    ID: dummy_state

    Function: cmd.run

    Name: echo nothing

    Result: True

    Comment: Command "echo nothing" run

    Changes:

    ----------

    pid:

    28198

    retcode:



    stderr:

    stdout:

    nothing

    Summary

    ------------

    Succeeded: 1

    Failed: 0

    ------------

    Total: 1
    Note the Salt-generated `Comment` key in the output. It definitively
    clarifies what's going on, but it is not controlled by user (author of
    SLS).

    It doesn't solve any technical issue, but it would be nice to have a
    possibility to add some description (i.e. `desc` key) which will
    become part of resulted output. For example:

    dummy_state:
    cmd.run: - name: echo nothing


    The output of such state could be like this:

    salt 'minion_id' state.sls dummy

    minion_id:

    ----------

    ID: dummy_state

    Function: cmd.run

    Name: echo nothing

    Result: True
    Description: run dummy command without side effect

    Comment: Command "echo nothing" run

    Changes:

    ----------

    pid:

    28198
    nothing

    Summary

    ------------
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/
    topic/salt-users/_FdniobxchE/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    [email protected].
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/d/optout.
  • Ryan Lane at Jul 30, 2014 at 5:14 pm

    On Wed, Jul 30, 2014 at 9:09 AM, wrote:
    Suppose I have a state in SLS file like this:

    dummy_state:
    cmd.run:
    - name: echo nothing

    I find it useful to use the ID as the comment:

       Run dummy command without side-effect:
         cmd.run:
           - name: echo nothing

    Note that this serves two purposes:

    1. It makes the state output much clearer.
    2. It makes your sls files read like documentation.

    - Ryan

    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/d/optout.
  • Alexey Pakseykin at Jul 30, 2014 at 5:54 pm
    Hi, Ryan

    You got the point in your statement: "I find it useful to use the ID as the
    comment".

    String of counter-complains: Unfortunately, when it comes to setup with
    hundreds of steps on tens of hosts where states use _libraries_ of Jinja
    templates (to tackle SLS code duplication), some hints in the report for a
    person who is not the author of the configuration (or is not even ready to
    look in the SLS sources) becomes very handy. If Windows
    (OS incompatible with 21 century's demands) is factored in, steps
    occasionally turn into necessary ugly hacks (i.e. http://goo.gl/zWdFFR).

    I'm not against simplicity. I just want to make it easier when things
    cannot be simplified. IMHO, complex environments is one of the potential
    Salt's stronghold.

    I also see a trend that there could probably be more new keys in the
    resulted output (i.e. http://goo.gl/CfHkEH for performance keys).
    This trend of only-growing number of keys should be addressed otherwise
    like adding key filter for default output.
    Otherwise reports have no potential to evolve for more specific
    applications.


    On Thu, Jul 31, 2014 at 1:13 AM, Ryan Lane wrote:

    On Wed, Jul 30, 2014 at 9:09 AM, wrote:


    Suppose I have a state in SLS file like this:

    dummy_state:
    cmd.run:
    - name: echo nothing

    I find it useful to use the ID as the comment:

    Run dummy command without side-effect:
    cmd.run:
    - name: echo nothing

    Note that this serves two purposes:

    1. It makes the state output much clearer.
    2. It makes your sls files read like documentation.

    - Ryan

    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Salt-users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/salt-users/_FdniobxchE/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    [email protected].
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedJul 30, '14 at 4:09p
activeJul 30, '14 at 5:54p
posts5
users3

People

Translate

site design / logo © 2023 Grokbase