kmpm / ansible-collection-incus

Collection of Ansible plugins for dealing with Incus from Linuxcontainers
GNU General Public License v3.0
14 stars 5 forks source link

Use the instance_name as ansible_host when using incus connection #3

Closed vheon closed 7 months ago

vheon commented 7 months ago

If we're using the incus connection we should use the instance name. Incus connection plugin treats the ansible_host as a FQDN and then split it in order to use the leading part as the instance name

https://github.com/ansible-collections/community.general/blob/b2b8fc30bf9bbccb8cab06a21833d2d7a179435b/plugins/connection/incus.py#L83-L86

Since we already have the instance name, just use that.

This would be true also for VMs that have the incus-agent running, but it requires more experimentation and we can fix it later.

kmpm commented 7 months ago

Thanks for shown interest