Replace docker_container_exec virt-install with community.libvirt module #15
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
neticenter/neticenter#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current
create.ymlusescommunity.docker.docker_container_execto runvirt-installinside the container via a raw shell command. This should be replaced with thecommunity.libvirt.virt_installAnsible module for a more declarative and maintainable approach.Proposed Approach
Use
delegate_to: neticenter-testto run thecommunity.libvirt.virt_installmodule inside the container where libvirt is available, rather than on the host machine.Prerequisites
python3-lxmlinstalled in the container (added to Dockerfile)python3-libvirtinstalled in the container (already present)community.libvirt >= 2.2.0added torequirements.ymlAcceptance Criteria
create.ymlusescommunity.libvirt.virt_installinstead ofdocker_container_execdestroy.ymlusescommunity.libvirt.virtto destroy the domainhttps://docs.ansible.com/projects/ansible/latest/collections/community/libvirt/virt_install_module.html
https://galaxy.ansible.com/ui/repo/published/community/libvirt/content/module/virt_install/