---

- name: Check if qemu agent channel is available
  stat: path=/dev/virtio-ports/org.qemu.guest_agent.0
  register: qemu_ga_dev

- include_tasks: guest_{{ ansible_os_family }}.yml
  when:
    - qemu_ga_dev.stat.exists
    - ansible_virtualization_type == 'kvm'
  tags: always

- name: Start and enable qemu guest agent
  service: name=qemu-guest-agent state=started enabled=True
  when:
    - qemu_ga_dev.stat.exists
    - ansible_virtualization_type == 'kvm'
