Get variable from variable set to custom ps script without using deployment package

Hi team,

we are using octopus 2.6.5 version.

i have a case, where i need to make a call to load balancer from powershell script on one of the servers. I want to do it separately from octopus itself, not using any deployment or using nuget package to deploy anything. Since the load balancer credentials is kept in a variable set in octopus, is it possible to get these credentials passed to my ps script from octopus as a variable to not expose credentials in plain text?

Checked script console, looks like it also doesnt support variables from octopus, you can’t get them from variable set. Also checked. tentacle.exe, but it works locally, with variables you pass manually via command line, so it can’t get any variables from octopus itself.

Any way getting needed variable parameters via API maybe?

Cheers!

Hi,

Thanks for reaching out. By far the easiest choice would be to install a Tentacle on your Octopus Server and put it on a separate Environment called “ScriptRunner”. Then create a separate project just for this specific task.

In 3.3 we’ll introduce a step type that will allow you to run steps on your Octopus server without installing a Tentacle on it.

From what I read, you seem to be willing to use the Script Console in Octopus. Why would you use that and not a Project which would instantly solve your current needs?

Regards,
Dalmiro

Thanks Dalmiro.This is smth that we would like to have outside octopus since we use octopus only for deployments so if we will be creating projects for tasks to execute scripts which are not related to deployment ir will be a big mess so for one time tasks it would great to be able to use something like script console or calamari/tentacle to get the parameters from variable sets…

Cheers!

Hi,

The below script will help you get variables from variable sets.

That won’t work with sensitive variables though. I’ll have to consult with the devs if that’s possible using the REST API (let me know if you need this)

I still believe having a dedicated project would be a lot easier. But I understand if that’s not possible in your scenario.

Hope that helps,
Dalmiro

thanks Dalmiro for your efforts. We will not use octopus for this, it looks like we found easier way for ops guys, so lets not put our efforts in this anymore. Cheers!