diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml
index 33fb08514226f6143b3940924ce107fbf791277d..8112be46985d1080b64d1e0f28f2b10f2f875fbc 100644
--- a/ansible/roles/cinder/tasks/config.yml
+++ b/ansible/roles/cinder/tasks/config.yml
@@ -101,4 +101,4 @@
   template:
     src: "roles/cinder/templates/cinder-volume.json.j2"
     dest: "{{ node_config_directory }}/cinder-volume/config.json"
-  when: inventory_hostname in groups['cinder-volume']
\ No newline at end of file
+  when: inventory_hostname in groups['cinder-volume']
diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml
index 541bd29d011e54bfb40ac184c1a247ff3d1879f0..8d138b11c87319d24529b8d9e1171e842c732e7e 100644
--- a/ansible/roles/neutron/tasks/config.yml
+++ b/ansible/roles/neutron/tasks/config.yml
@@ -141,6 +141,7 @@
   template:
     src: "roles/neutron/templates/neutron-server.json.j2"
     dest: "{{ node_config_directory }}/neutron-server/config.json"
+  when: inventory_hostname in groups['neutron-server']
 
 - name: Copying Neutron OpenVSwitch JSON configuration file
   template:
diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml
index fa7183b2322241f197b6abb4809f043e88063925..9d5730402bedac7c88058ff6be3859f7764da1c8 100644
--- a/ansible/roles/nova/tasks/config.yml
+++ b/ansible/roles/nova/tasks/config.yml
@@ -23,6 +23,7 @@
   template:
     src: "roles/nova/templates/nova-api.json.j2"
     dest: "{{ node_config_directory }}/nova-api/config.json"
+  when: inventory_hostname in groups['nova-api']
 
 - include: ../../config.yml
   vars:
@@ -48,6 +49,7 @@
   template:
     src: "roles/nova/templates/nova-conductor.json.j2"
     dest: "{{ node_config_directory }}/nova-conductor/config.json"
+  when: inventory_hostname in groups['nova-conductor']
 
 - include: ../../config.yml
   vars:
@@ -73,6 +75,7 @@
   template:
     src: "roles/nova/templates/nova-consoleauth.json.j2"
     dest: "{{ node_config_directory }}/nova-consoleauth/config.json"
+  when: inventory_hostname in groups['nova-consoleauth']
 
 - include: ../../config.yml
   vars:
@@ -98,6 +101,7 @@
   template:
     src: "roles/nova/templates/nova-scheduler.json.j2"
     dest: "{{ node_config_directory }}/nova-scheduler/config.json"
+  when: inventory_hostname in groups['nova-scheduler']
 
 - include: ../../config.yml
   vars:
@@ -123,6 +127,7 @@
   template:
     src: "roles/nova/templates/nova-compute.json.j2"
     dest: "{{ node_config_directory }}/nova-compute/config.json"
+  when: inventory_hostname in groups['compute']
 
 - include: ../../config.yml
   vars:
@@ -148,13 +153,16 @@
   template:
     src: "roles/nova/templates/nova-novncproxy.json.j2"
     dest: "{{ node_config_directory }}/nova-novncproxy/config.json"
+  when: inventory_hostname in groups['nova-novncproxy']
 
 - name: Ensuring config directory exists
   file:
     path: "{{ node_config_directory }}/nova-libvirt"
     state: "directory"
+  when: inventory_hostname in groups['compute']
 
 - name: Copying Nova Libvirt JSON configuration file
   template:
     src: "roles/nova/templates/nova-libvirt.json.j2"
     dest: "{{ node_config_directory }}/nova-libvirt/config.json"
+  when: inventory_hostname in groups['compute']