Merge "Compatibility with Debian and Ubuntu 16.04"
diff --git a/nova/compute.sls b/nova/compute.sls
index f6a68fb..02b636a 100644
--- a/nova/compute.sls
+++ b/nova/compute.sls
@@ -142,12 +142,16 @@
 
 {% endif %}
 
+{%- if compute.libvirt_bin is defined %}
 {{ compute.libvirt_bin }}:
   file.managed:
   - source: salt://nova/files/{{ compute.version }}/libvirt.{{ grains.os_family }}
   - template: jinja
   - require:
     - pkg: nova_compute_packages
+  - watch_in:
+    - service: {{ compute.libvirt_service }}
+{%- endif %}
 
 /etc/libvirt/qemu.conf:
   file.managed:
@@ -178,7 +182,6 @@
     - cmd: virsh net-undefine default
   - watch:
     - file: /etc/libvirt/{{ compute.libvirt_config }}
-    - file: {{ compute.libvirt_bin }}
 
 {%- endif %}
 
diff --git a/nova/controller.sls b/nova/controller.sls
index 608ff3c..90c721f 100644
--- a/nova/controller.sls
+++ b/nova/controller.sls
@@ -2,6 +2,18 @@
 
 {%- if controller.enabled %}
 
+{%- if grains.os_family == 'Debian' %}
+nova_consoleproxy_debconf:
+  debconf.set:
+  - name: nova-consoleproxy
+  - data:
+      'nova-consoleproxy/daemon_type':
+        type: 'string'
+        value: 'novnc'
+  - require_in:
+    - pkg: nova_controller_packages
+{%- endif %}
+
 nova_controller_packages:
   pkg.installed:
   - names: {{ controller.pkgs }}
diff --git a/nova/map.jinja b/nova/map.jinja
index 3c1aa98..d8d7f36 100644
--- a/nova/map.jinja
+++ b/nova/map.jinja
@@ -21,10 +21,9 @@
 {% set compute = salt['grains.filter_by']({
     'Debian': {
         'pkgs': ['nova-compute-kvm', 'python-novaclient', 'pm-utils', 'sysfsutils', 'sg3-utils', 'libvirt-bin', 'python-memcache', 'qemu-kvm','python-guestfs'],
-        'services': ['nova-compute', 'libvirt-bin'],
+        'services': ['nova-compute'],
         'libvirt_config': 'libvirtd.conf',
-        'libvirt_bin': '/etc/default/libvirt-bin',
-        'libvirt_service': 'libvirt-bin',
+        'libvirt_service': 'libvirtd',
         'bind': compute_bind_defaults,
         'debug': false,
         'identity': {
@@ -51,4 +50,9 @@
         },
         'heal_instance_info_cache_interval': '60',
     },
-}, merge=salt['pillar.get']('nova:compute')) %}
+}, merge=salt['grains.filter_by']({
+    'trusty': {
+        'libvirt_bin': '/etc/default/libvirt-bin',
+        'libvirt_service': 'libvirt-bin',
+    },
+}, grain='oscodename', merge=salt['pillar.get']('nova:compute'))) %}