Using shell in manageIQ

Hi !

I wonder how i can perform some script shell on a VM.

So i want to know if something exist to perform that. And which communication’s mode are used to launch shell scripting

I know in others solution i can directly import my script and perform it on my vm through VMware tools so i don’t need to make connection with my VM

i saw net-ssh in local gem, but i failed to make it work and it’s not a solution for me i want something writing in shell only

You could probably use Ansible to launch a shell script on the VM.

pemcg

Hum so you telling me there is no way to use shell or powershell script directly with manageIQ
except using local gem (only net-ssh) already install with your appliance ?

Well you can think of embedded Ansible on the appliance as the GUI wrapper around the difficult parts of what you’re trying to do, such as defining and exchanging credentials, making the ssh connection to the target, etc.

Once you’ve set that up you can run a very simple Ansible playbook such as:

- name: Execute the command in remote shell; stdout goes to the specified file on the remote
  shell: somescript.sh >> somelog.txt

(See ansible.builtin.shell – Execute shell commands on targets — Ansible Documentation for more details)

That would be much easier than coding your own solution using something like net-ssh, and is all out-of-the-box stuff.

Hope this helps,
pemcg

Okay, thanks ! I’m going to see that.