Can't create new VM
pziemkowski opened this issue · 2 comments
Hello,
I am trying to use this role to create new VM and I encountered a problem while running domain/create role.
Here is my playbook:
---
- hosts: all
sudo: yes
user: vagrant
roles:
- ansible-libvirt/host/provision
- ansible-libvirt/images/ubuntu-cloud
- ansible-libvirt/domain/create
here is an output:
TASK: [ansible-libvirt/domain/create | ports | ssh] ***************************
fatal: [default] => One or more undefined variables: 'dict object' has no attribute 'ssh_port'
I'm really new to ansible, so there is a possibility that I'm doing something wrong.
Should I set some role specific variables to create a domain? Can't find anything in comments.
Thx, for the first ticket here and sorry that it did not worked for you.
These roles are considered unstable, for the lack of public examples.
To create a named domain, you need the following arguments.
---
roles:
- role: hicknhack-software.libvirt/domain/create
libvirt_domain_name: "example"
libvirt_ssh_port: 37331
libvirt_domain_groups: ['example']
Doing a domain/list
combined with some add_host
we get all domains into our Ansible run and provision them with the groups.
Maybe I will find some time soon, to add an example.
Good luck!
Feel free to ask, if you have questions.