-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[2017.7.0rc1] use_superseded and module.run changes from release notes do nothing? #42148
Comments
@Ch3LL please assign me to this issue. I'll look at this tomorrow. |
looks like i can't assign it to you via github, but we will wait for your analysis and not assign it out to anyone else. Thanks for taking a look :) |
@Ch3LL @sjorge use_superseded:
- module.run Restart your minion, from now on your Now for the calling syntax itself. As per YAML syntax, the correct way to call the argument-less functions like how_to_call_without_arguments:
module.run:
- test.ping: # Notice the colon at the end! This colon at the end is required in this case, as the state compiler will cry that the function is not formed as a list (you've got it too, BTW). But those functions with the arguments called simply adding the arguments in obvious way: how_to_call_with_the_arguments:
module.run:
- test.echo:
- text: "Hi, there!" Quotes are optional. Or something like this all together: how_to_call_everything_at_once:
module.run:
- cmd.run:
- cmd: uname -a
- test.echo:
- text: Hi, there! No quotes here
- test.ping: The above gives me the following result:
Now, if you leave the state untouched but remove the configuration of the minion
And your log file will have the following entries:
If you want it still run in old way, modify your SLS file to the following: run_test_ping:
module.run:
- name: test.ping
run_test_echo:
module.run:
- name: test.echo
- text: 'Hi, there!'
run_cmd_run:
module.run:
- name: cmd.run
- cmd: uname You will now be able to run it, but you will be running three operations three times and will get three warnings in your log. 😉 So the difference here is that the new syntax allows you:
Hope it helps! Greetings from sunny Germany and have a nice weekend! |
I have confirmed that this works.
|
@isbm thanks for providing an example for us and thanks @gtmanfred for confirming it works as well. @sjorge can you also confirm this works for you? |
I can confirm this works. Perhaps some extra clarification should be added to the release notes (and docs) |
👍
…On Fri, Jul 7, 2017 at 10:27 AM, Jorge Schrauwen ***@***.***> wrote:
I can confirm this works.
Perhaps some extra clarification should be added to the release notes (and
docs)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42148 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAssofZsnkidtexJgzgKH0l7mEOp3_4Kks5sLlxsgaJpZM4OO6cx>
.
|
actually the examples in the docs rightfully cause the error https://github.com/saltstack/salt/blob/develop/salt/states/module.py#L27 That's incorrect in both the old & new syntax ;) |
Good Catch, that needs to be fixed. It should be
|
Exactly, which is what tripped me (& probably @sjorge as well) up; notice it's almost consistently wrong too ;) |
Apologies for being dense, but how exactly does it need to look in python? I have now
and it works but throws the warning
Do I just need |
do you have the use_superseeded somewhere in the config?
…On Wed, Aug 2, 2017 at 11:21 AM, dmaziuk ***@***.***> wrote:
Apologies for being dense, but how exactly does it need to look in python?
I have now
for u in __pillar__["user_list"].keys() :
rc[u] = { "module.run" : [
{ "name" : "shadow.set_password" },
{ "m_name" : __pillar__["user_list"][u]["name"] },
{ "password" : __pillar__["user_list"][u]["password"] }
] }
...
return rc
and it works but throws the warning
The function "module.run" is using its deprecated version and will expire in version "Sodium".
Do I just need deprecation.conf to shut the warning up? Or what?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42148 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAssoZmE2jRb9Wv1S45m9mFVvhqWslHyks5sULAXgaJpZM4OO6cx>
.
|
@gtmanfred: Nope. I just saw the warning in the logs while investigating something else and google turned up this issue. Like I said, it all seems to be working fine. |
Hello, any news ? It looks like this can be closed as fixed (unless I am missing something) |
worksforme |
@marco-m I think, RC1 is fine, but look at 2018.3 instead. 😉 Maybe we can close the issue, @rallytime? |
any idea for enable this feature under |
@dreampuf good point. In general, this is not about syntax change, but overall migration mechanism, since everything in Salt is subject to change in ~1 year. So as long as you keep using older versions, this is a very good idea to think of! |
Description of Issue/Question
Following the release notes here https://docs.saltstack.com/en/develop/topics/releases/2017.7.0.html#state-module-changes
I run into the following issue...
I played tried a few different things based on the example
For now i have reverted to the old state file which works fine:
This works with or without the following in the minion config
Setup
See above
Steps to Reproduce Issue
See above
Versions Report
The text was updated successfully, but these errors were encountered: