Update remove files

Howdy.

I'm currently hoping to putty to a number of Linux VMs and update a hosts file remotely before moving on to the next VM in a list. Does anyone have a script that does anything similar? Are there any decent script repositories online?

Welcome seanbeag,

I have a few to questions pose in response first:-

  • How would you do this without automation?
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • Do you have security credentials set up on each server? (password-less login for scheduled tasks)
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.

We're all here to learn and getting the relevant information will help us all.

Kind regards,
Robin

1 Like

Hi Robin, thanks for the response:

  • How would you do this without automation?

Currently the way this is done is by literally consoling onto every virtual machine in the environment. The hosts file is then updated, some software downloaded from an ftp site and the software is then installed. I'm trying to automate the whole process, because this is time consuming and antiquated.

  • What have you tried so far?

I currently have a bash script I run locally where I can update my own hosts file, and one or two remote hosts files, but this is done by tying in the name of each remote machine one by one and I don't really want to go testing this in a virtual environment

  • What output/errors do you get?
  • What OS and version are you using?

As it's a virtual environment there's a mixture of OS types, Windows, CentOS, Linux, OpenSuse etc

  • Do you have security credentials set up on each server? (password-less login for scheduled tasks)

Not presently not. There are certain accounts that will work across multiple VMs though

  • What are your preferred tools? (C, shell, perl, awk, etc.)

I don't really have a preferred tool

  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Would ideally like to be able to run a script that will connect to a pre-defined list of remote VMs and:
1 - Update their host file
2 - Copy some install files to a directory on that remote VM and kick off the install
3 - Start the service post install

Most importantly, What have you tried so far?

This is well outside my comfort zone to be honest so I'm hoping for something that may be tried and tested. If that doesn't exist then no worries