Pasting server names into "target roles" in Script Console

Hi,

I’ve been trying to paste a list of server names from notepad into the “Target roles” text box in the Script Console but it doesn’t seem to resolve multiple server names. Maybe I’m doing it wrong, in which case ignore this ticket :-).

In my particular case I’m trying to run an ad-hoc cleanup script on a list of servers that are running out of disk space according to an external monitoring system. There’s 20-30 servers in my list (which is hundreds of servers long) and I’ve got to type them in one at a time and click the name in the “target roles” box in the script console rather than just paste the list from the monitoring server.

I’ve also been heavily using the feature to run a bunch of different audit scripts to check the status of various configuration items on all my servers, and I’d like to be able to just paste my various non-compliant server lists into the “target roles” text box whenever I come back to do another round of auditing. Again, it’s an ad-hoc list that doesn’t necessarily correlate to an environment or server role.

And finally, while I’m in full swing, when you run a script against an environment using the “Run the script on all deployment targets in set of environments and roles” radio button, the script fails and stops when it hits the first “unhealthy” tentacle. It’d be nice to be able to check a box saying “skip unhealthy servers” or something.

They’re minor irritations in an otherwise great product, but they’d streamline one of my use cases and remove a speed bump that I keep hitting.

Cheers,

Mike

Hi Michael,

Thanks for getting in touch! We quite like the idea of doing this but it is not something that’s currently possible in Octopus.
Are your target roles changing often or do you have a pre-made list that you refer to?

Generally for any activity where you want to repeat it and have variable information we do recommend creating a project instead for reusability.

Looking forward to hearing from you.

Regards,
Daniel

Hi Daniel,

Thanks for taking the time to respond.

A couple of my use cases might fit into pre-defined projects and roles, but in most cases the target server lists are dynamic - e.g. cleaning up temp files from servers with low disk space as reported by our monitoring infrastructure. And in other cases it’s a true ad-hoc script - e.g. the ops manger asks me one day how many servers in a specific vlan can telnet to an internal server / port through our firewalls? or the security team want to know what web servers have Setting X in Configuration File Y set correctly?

I’m probably using Octopus a bit more like an Ops orchestration server than a deployment system (although the devs here love it for deployment, too!) -
I can write one-off powershell scripts to find this out and it’s just really handy to be able to orchestrate it and collect the results using the Octopus Deploy’s ad-hoc script console across multiple severs.

I might be trying to use it for something it’s not specifically designed for, which is fine, but you think it has a more generic usefulness I’d love to be able to cut and paste server names into the target textbox.

The other point about skipping unhealthy servers is also useful - if I try to run a script against an environment rather than a list of servers, it fails if a server is unhealthy or has been switched off. That’s not normally a problem in PROD, but the devs do like playing whack-a-mole with servers in DEV and TEST, and rebooting them randomly during the day.

Cheers,

Mike

Hi Michael,

Thanks for getting back! What you are doing is currently the best option seeing as your lists are dynamic. We like the idea of being able to paste into the roles field and think it will make things easier for a lot of people. I have created a GitHub issue to have the devs look at (Link below). I should note that there are quite a few changes we have on the backlog so this probably won’t take urgent status.

Again, thanks for bringing this up! :slight_smile:

Regards,
Daniel

Notice:

This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.