---
- name: nova user
  user: name=nova shell=/bin/false

- apt: pkg=python-numpy

- name: create nova patches directory
  file: path=/opt/stack/patches/nova/ state=directory owner=root group=root mode=0755

- name: download nova patches
  get_url: url={{ item }} dest=/opt/stack/patches/nova/
  with_items: nova_common.patches
  when: nova_common.patches is defined

- name: register nova patches
  command: ls /opt/stack/patches/nova/
  register: nova_common_patchfiles

- name: get nova source repo
  git: |
    repo={{ openstack.git_mirror }}/nova.git dest=/opt/stack/nova version={{ nova_common_rev }} depth=5
  notify:
    - patch nova
    - pip install nova
    - nova rootwrap
    - restart nova services
- meta: flush_handlers

- name: patch nova
  patch: basedir=/opt/stack/nova patchfile=/opt/stack/patches/nova/{{ item }} strip=0
  with_items: nova_common_patchfiles.stdout_lines
  notify:
    - pip install nova
    - restart nova services
- meta: flush_handlers

- file: dest=/etc/nova state=directory
- file: dest=/var/lib/nova state=directory owner=nova
- file: dest=/var/cache/nova state=directory mode=0700 owner=nova group=nova

- name: nova config
  action: template src={{ item }} dest=/etc/nova mode=0644
  with_fileglob: ../templates/etc/nova/*
  notify:
    - restart nova services

- name: nova sudoer
  template: src=etc/sudoers.d/nova dest=/etc/sudoers.d/nova owner=root group=root mode=0440

---
- name: nova user
  user: name=nova shell=/bin/false

- apt: pkg=python-numpy

- name: get nova source repo
  git: |
    repo={{ openstack.git_mirror }}/nova.git dest=/opt/stack/nova version={{ nova_common_rev }} depth=5
  notify:
    - pip install nova
    - nova rootwrap
    - restart nova services
- meta: flush_handlers

- file: dest=/etc/nova state=directory
- file: dest=/var/lib/nova state=directory owner=nova
- file: dest=/var/cache/nova state=directory mode=0700 owner=nova group=nova

- name: nova config
  action: template src={{ item }} dest=/etc/nova mode=0644
  with_fileglob: ../templates/etc/nova/*
  notify:
    - restart nova services

- name: nova sudoer
  template: src=etc/sudoers.d/nova dest=/etc/sudoers.d/nova owner=root group=root mode=0440

Remove nova patching. Not needed.
Remove nova patching.  Not needed.

Remove nova patching as we do not need it and it is causing headaches.
