This [localhost] means that the task is invoked to localhost instead of your ESXi. You should specify the target node of this task to your ESXi, by changing hosts on your playbook or delegate_to on the task.
hi…Please read the error once again …the error reports something different not for the localhost issue. I tired all the steps … If you have any idea please reply or else ignore.
msg": “[Errno 2] No such file or directory: b’esxcli’”, “rc”: 2, “stderr”: “”, “stderr_lines”: , “stdout”: “”, “stdout_lines”: }
This means that your task is trying to run esxicli on localhost with SSH or local connection.
I don’t think this is correct for your task, and that’s why I repeatedly mentioned hosts and delegate_to.
If the No such file or directory error is truly came from ESXi, the line fatal should start with the ESXi hostname or IP address as follows:
I’ve started with ESX 2.5 nearly 20 years ago and I’m also maintaining community.vmware.
That said, we’re using this collection heavily at work. But I would never use it to update ESXi hosts. I don’t think Ansible is the right tool to do this. Use vCenter Lifecycle Manager for this.
If you want to run esxcli commands, maybe you should have a look at Get-EsxCli. We use PowerCLI a lot where Ansible doesn’t feel like the right tool (or community.vmware simply lacks the functionality we need).
Hi Mariolenz,
I know this is an older post…please bare with me. I wholehartedly agree about using vCenter Lifecycle Manager to update; however, any way to trigger the cluster remediation action from ansible? Im looking to integrate our ticketting system into ansible and essentially have the following process kick off:
admin submits a scheduled change request
on approval, connect to ansible aap and schedule cluster remediation
collect failure output
I am very new to ansible and just now getting familiar with community.vmware module. I have an idea on how to complete what I want using PowerCLI but I would like to centralize automations into AAP.
Is this even possible or should i just go the PowerCLI route and just piece a hybrid of the two?
@vuser ATM it’s not possibly. I haven’t figured out yet how to control vCenter Lifecycle Manager stuff through the API, which I would need to implement this.
Anyway, when I do I think managing cluster images would be more important than triggering an update.
So if you want to have a quick solution, use another way like PowerCLI or something similar. I don’t know when we’ll be able to implement this.
BTW If you’re new to ansible and community.vmware, I suggest to also have a look at vmware.vmware and vmware.vmware_rest. I don’t think those collections have a solution for your problem, but they might provide some interesting modules to fix other problems you might run into.
Especially have a look at vmware.vmware since I’ve started to deprecate modules in community.vmware in favour of ones in this collection
@mariolenz hey there! thank you for the reply. I did check out the other two but its as you said. By the way thank you for the work you and the others put into this. So far im loving the learning experience and currently tearing my hair out with the vmware_guest module but in all im enjoying it lol.
Im thinking I might have some luck just executing a powercli script from anisible. This will probably be a good Friday task.
Thanks again for the reply, much appreciated! take care.