I am a postgrad student. This question is for my final-year project.
I have a host machine running Slackware and is publicly accessible through SSH. I do not have access to install anything with sudo on the host machine.
On that host machine, I have several QEMU virtual machines running with no networking configured (i.e. no IP addresses assigned). These virtual machines are managed through a CLI tool designed by the university. The CLI tool is similar to libvirt or Proxmox and runs these machines inside a tmux session. Also, each virtual machine has a username and password.
I am able to connect to the host machine through SSH using Ansible.
My goal is to be able to connect to the QEMU virtual machines and configure basic networking in each virtual machine using Ansible.
Here are my limitations.
- I cannot use community.libvirt.libvirt_qemu because my user is not in the
sudogroup. I wish there was a pure QEMU connection plugin. - I was not able to find any Ansible connection plugin to connect to a tmux session.
What is the best possible way to achieve this?
You say: "These virtual machines are managed through a CLI tool designed by the university. The CLI tool ... runs these machines inside a tmux session."
Q: I was not able to find any Ansible connection plugin to connect to a tmux session. What is the best possible way to achieve this?
A: The best possible way is to write an Ansible module that will use your CLI tool to manage these virtual machines. This means, instead of using tmux to run your CLI
you'll run your CLI from your Ansible module
See:
Ansible architecture
Developer Guide
Developing modules
The simplest solution would be to try running your CLI from Ansible module command or shell. You'll probably have to keep the CLI running in the background. See Asynchronous actions and polling. But, very probably you'll have to run the CLI as a daemon. It's up to you to decide what is better. Either write the Ansible module or update the CLI to work with the Ansible modules command or shell.