-
Notifications
You must be signed in to change notification settings - Fork 86
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
environ of upcall commands #546
Comments
[disclaimer] I'm the main developer of Cumin, sorry for the intrusion, I hope I'm not crossing a line here [/disclaimer] @btwe another possibility (that requires some work though) could be to use wikimedia/cumin that is build on top of ClusterShell for the remote execution part but allows to query different backends for hosts selection, including custom ones. For your specific use case though you'll need to write your own custom backend as there isn't one for Ansible. |
Hi @btwe I don't think we can change this default directory which is set on purpose, see https://github.com/cea-hpc/clustershell/blob/master/doc/man/man5/groups.conf.5#L140-L142 I'm not sure i understand the performance issue you are talking about. Could you give me example of what command is slow and how long? |
Also where is located |
Hi @degremont many thanks for your reply.
Yes, I assumed this would break other setups. But I think I can work around this. It seems to be possible to place some scripts in
The performance issue is not in clustershell. The call to
This would be available in the cwd I am currently working in. I think this issue can then be closed. @volans- thanks for pointing out cumin. |
this is not the right way to do this.
|
Perfect, |
The situation is clear to me. Thanks for all the support. Fmpov, you can close this. |
My aim is to configure a groupsource which pulls the information from an ansible inventory configuration . The benefit would be, that I only have to manage the host-inventory and groups in ansible and clustershell is able to consume those as well.
According to the docs it should be possible to
define a groupsource like:
This requires that the upcall commands are executed in the same environment as the cli-command.
But clustershell executes those commands in a
subprocess.Popen
in which is sets thecwd=self.cfgdir
link.ansible-inventory
cannot find the inventory dir and fails.The following patch works for me, but I do not know how deep this reaches and afflicts other use cases.
What do you think:
Using
nodeset
orcluset
is painfully slow then, because those CLI commands tread all names as groupnames and try to resolve them in a loop, where each call toansible-inventory
is quite slow. Butclush -bg GRPNAME
works reasonable well, because there seems to be only one resolve call.The text was updated successfully, but these errors were encountered: