# vmm ~~ tasks/generate_vmconf.yml --- - name: Generate vmm configuration template: src: templates/vm.conf.j2 dest: "{{ vmm.config.file }}" - name: Create empty disk file: path: "{{ vmm.disk.dir }}/{{ hostvars[item].ansible_host }}.{{ vmm.disk.format }}" state: touch loop: "{{ vm.hosts }}" - name: Restart and enable vmd service: name: vmd state: restarted enabled: true when: vm.enabled - name: Stop and disable vmd service: name: vmd state: stopped enabled: false when: not vm.enabled