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

36 lines
787 B
YAML
Raw Normal View History

2021-06-06 21:46:18 +02:00
---
2021-06-09 21:07:20 +02:00
- include_vars: vm_templates.yml
- name: test
debug:
msg: "{{ vm_templates[item] }}"
loop: "{{ vm_templates|flatten(1) }}"
2021-06-06 21:46:18 +02:00
- name: fetch images
get_url:
2021-06-09 21:07:20 +02:00
dest: "{{ libvirt.images }}/{{ vm_templates[item].image.filename }}"
2021-06-06 21:46:18 +02:00
group: root
owner: root
mode: u=rw,g=r,o=r
2021-06-09 21:07:20 +02:00
url: "{{ vm_templates[item].image.url }}"
checksum: "{{ vm_templates[item].image.checksum }}"
loop: "{{ vm_templates|flatten(1) }}"
2021-06-06 21:46:18 +02:00
- 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