On RedHat based distros /bin/ is a symlink to /usr/bin:
[will@dev-director ~]$ ls -lia /bin
410146 lrwxrwxrwx. 1 root root 7 Jun 11 12:07 /bin -> usr/bin
Whereas on the Ubuntu it is seperate directory. Using
/usr/bin/virsh should work on both.
ubuntu:
stack@ubuntu:~/ansible-role-libvirt-vm$ whereis virsh
virsh: /usr/bin/virsh /usr/share/man/man1/virsh.1
centos:
[will@dev-director ~]$ whereis virsh
virsh: /usr/bin/virsh /usr/share/man/man1/virsh.1.gz
Also removed a misleading comment. QEMU uses differnt
"instances" for privaleged and user access i.e the
"system" and "session" instances. The comment seemed
to suggest using /bin/virsh would connect to the
system instance (at least that is how I read it).
At least this is the case on ubuntu:
(.venv) stack@ubuntu:~/tenks$ ovs-vsctl list-br
ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (Permission denied)
This is with the view that tenks should support multiple
GNU/Linux distributions. The package module abstracts
over the differences between package managers.
Tenks has a dependency on ansible. We need to make sure this is installed
before we run `ansible-galaxy install`. `pip install .` was therefore moved
above `ansible-galaxy install` in the installation steps.
The OpenStack client Python package is not necessarily installed in the
Tenks virtualenv until the role is run, so we need to query OpenStack
for the image IDs inside the role.
You can now use either a name or a UUID for these images. Also, remove
the unnecessary setting of node states, which is now handled by the
scheduling plugin.
Each volume needs its own volume, so to ensure separate volumes are
created for every node, give each volume a unique name comprising the
parent node's name and the volume's index within the node's volume list.
Add a cleanup_state.yml playbook that is run after every deployment and
teardown. It will remove any nodes marked as 'absent' from the state
file, by calling schedule.py with `prune_only=True`.
Instead of overwriting the physnet mappings specified in the Tenks
configuration, create a separate dict that maps physnet names to their
indices. Like physnet_mappings, this will be present for each
hypervisor.