Avoid typo (dry-run): salt-ssh somehost state.sls webserver.root rest=True

76 views
Skip to first unread message

Thomas Güttler

unread,
Sep 10, 2019, 5:14:57 AM9/10/19
to Salt-users
If I want to test what happens, I use "test=True".

Just now I did this:

    salt-ssh somehost state.sls webserver.root rest=True

And the state got applied. It was live, not dry-run like I wanted.

I was lucky, the typo ("rest" instead of "test") did no harm.

But is there no better way? With "better" I mean: if I have
a type in the dry-run argument, then the tools should
do nothing and tell me that I did a typo.

According to this page "test=True" seems like the current "state of the art":

Regards,
  Thomas Güttler

Guillaume De Koker

unread,
Sep 10, 2019, 8:07:56 AM9/10/19
to salt-...@googlegroups.com
In our team, most people use an alias with a reverse logic. if they don't specify test=false, it won't apply.
If i'm not wrong, it's up to you right now, there is nothing in place to force it to true.

--
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 salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/446eab30-fdca-42e5-bcb2-79531f9f04d3%40googlegroups.com.


--


Guillaume DE KOKER
Administrateur Système et Réseaux
guillaume...@webedia-group.com

2, rue Paul Vaillant Couturier - CS 60102 - 92532 Levallois-Perret Cedex - T: +33 1 84 20 09 84

Dimitri Maziuk

unread,
Sep 10, 2019, 11:33:06 AM9/10/19
to salt-...@googlegroups.com
On 9/10/2019 7:07 AM, Guillaume De Koker wrote:
> In our team, most people use an alias with a reverse logic. if they
> don't specify test=false, it won't apply.

--dry-run should be a command-line argument, then if you mistype
--fry-bun argparse will barf and not run the command. When it's an
arbitrary key-value pair with no checking, that's just bad UI.

Dima

Salty Vagrant

unread,
Sep 10, 2019, 2:01:28 PM9/10/19
to 'Dimitri Maziuk' via Salt-users

I’ve recently take not setting test: True in pillar data. Then one has to specify a command line override (e.g. test=True) to have a state/highstate actual apply.

--

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 salt-users+...@googlegroups.com.

Thomas Güttler

unread,
Sep 11, 2019, 4:49:09 AM9/11/19
to Salt-users
Thank you all for your feedback. Now I now that I am not alone with this pain.
I have plans for the future, but I don't want to discuss them here.
Reply all
Reply to author
Forward
0 new messages