-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Task level user setting looks not working, docs mistake #192
Comments
Maybe I am wrong, but here looks like the root of the problem: Line 91 in c9fd185
should it be |
just to clarify if this is not a typo in your playbook before I go any deeper - you said "... playbook to have 2 tasks, each on different remote" however the playbook you provided runs both tasks on the same |
Yup, this is a typo, I meant host1 and host2, of course |
so, I would assume it fails with a correct host, right? If this is the case, I'll take a look. in the meantime, you can specify top-level targets and set the user here, i.e.
|
The change eliminates setting the default task.User on the config level, and moves this responsibility to the runner. Now the runner explicitly checks the presence of task.User and passes it in. In addition, runTaskOnHost sets the passed user into activeTask (a copy of the task used later on). This was done to be able to know what the actual user is. Currently, the only use is in setting SPOT_REMOTE_USER, however, it can also be used in any place that needs to know the active remote user.
* Fix incorrect handling of task-level user #192 The change eliminates setting the default task.User on the config level, and moves this responsibility to the runner. Now the runner explicitly checks the presence of task.User and passes it in. In addition, runTaskOnHost sets the passed user into activeTask (a copy of the task used later on). This was done to be able to know what the actual user is. Currently, the only use is in setting SPOT_REMOTE_USER, however, it can also be used in any place that needs to know the active remote user. * update man and site * add a test for user name set on task level
the fix on master, please give it a try. It should properly support task-level user now. I have also updated the docs. |
it works, thanks! |
Hello,
Noticed that in docs section https://spot.umputun.dev/#playbook-types said that I can specify
ssh_key
:But link leads to https://spot.umputun.dev/#tasks-and-commands, where it is said that only 3 of 4 fields are available:
on_error
,user
,targets
.Actually I am trying to config my playbook to have 2 tasks, each on different remote. Here is playbook:
But it is not working. If I specify user=user1 on playbook level, then t1 is working and t2 crashes with
Obviously, because of wrong user selection
Also it is not clear if
ssh_key
is supported on task level?Currently my workaround is to have 2 separate playbooks for each host
The text was updated successfully, but these errors were encountered: