ansible-test/roles/virt/tasks/main.yml

36 lines
787 B
YAML

---
- include_vars: vm_templates.yml
- name: test
debug:
msg: "{{ vm_templates[item] }}"
loop: "{{ vm_templates|flatten(1) }}"
- name: fetch images
get_url:
dest: "{{ libvirt.images }}/{{ vm_templates[item].image.filename }}"
group: root
owner: root
mode: u=rw,g=r,o=r
url: "{{ vm_templates[item].image.url }}"
checksum: "{{ vm_templates[item].image.checksum }}"
loop: "{{ vm_templates|flatten(1) }}"
- name: virt_net "docker" present
virt_net:
autostart: yes
name: docker
state: present
xml: '{{ lookup("template", "network/docker.xml.j2") }}'
- name: virt_net "docker" autostart
virt_net:
name: docker
autostart: yes
- name: virt_net "docker" active
virt_net:
name: docker
state: active
autostart: yes