---
# Ensure this file is written before kvm_intel or kvm_amd module is loaded
- name: enable nested kvm
  template: src=etc/modprobe.d/kvm-nested.conf dest=/etc/modprobe.d/kvm-nested.conf owner=root group=root mode=0644

- action: apt pkg={{ item }}
  with_items:
    - libvirt-bin
    - python-libvirt
    - kvm
    - open-iscsi

- name: ensure kvm is supported by cpu and enabled in bios
  command: kvm-ok
  when: "'{{ nova_common_libvirt_type }}' == 'kvm'"
  changed_when: False

- file: dest=/var/lib/nova/instances state=directory owner=nova
- template: src=etc/init/nova-compute.conf dest=/etc/init/nova-compute.conf owner=root group=root mode=0644
- service: name=nova-compute state=started

---
# Ensure this file is written before kvm_intel or kvm_amd module is loaded
- name: enable nested kvm
  template: src=etc/modprobe.d/kvm-nested.conf dest=/etc/modprobe.d/kvm-nested.conf owner=root group=root mode=0644

- action: apt pkg={{ item }}
  with_items:
    - libvirt-bin
    - python-libvirt
    - kvm
    - open-iscsi

- name: ensure kvm is supported by cpu and enabled in bios
  command: kvm-ok
  when: "'{{ nova_common_libvirt_type }}' == 'kvm'"
  changed_when: False

- user: name=nova groups=libvirtd
- file: dest=/var/lib/nova/instances state=directory owner=nova
- template: src=etc/init/nova-compute.conf dest=/etc/init/nova-compute.conf owner=root group=root mode=0644
- service: name=nova-compute state=started

Revert "Remove duplicate definition of nova user."
Revert "Remove duplicate definition of nova user."

This reverts commit 3b2fa44cd6c7b8ce3534d7dcca35fa1a93d2dca9.

This was not unnecessary after all - it causes
nova user to be in libvirtd group on compute nodes.
