0
votes

My situation is as follows. I am using the vSphere Jenkins plugin to clone and start a VM on a vSphere server during a stage of a pipeline. I use SSH to connect to the VM from the Jenkins master and start the slave. VMware tools is installed on the machine so that the vSphere Jenkins plugin knows what IP to SSH to.

Now comes the problem: I need to change the IP address of each VM after startup. For that I am using a script that changes the IP of the machine, wrapped in a systemd oneshot service which loads the script on startup. The issue is that VMware tools sends the IP information back to the jenkins plugin before the systemd service gets loaded and then Jenkins tries to connect to an IP that has been changed.

How do I delay the start of VMware tools or how else could I overcome this issue?

1

1 Answers

0
votes

I ended up adding this line in the [Unit] section of my .service file:

Before=vmware-tools.service

It does what I want it to.