diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/compile_template.yaml b/geant/gap_ansible/roles/iptrunk_migration/tasks/compile_template.yaml
index 994d83e8b62ecbcb87bbd83436936aadcd9c1bb4..0d645ce6f3de67f19ada01b28c2be34326815f72 100644
--- a/geant/gap_ansible/roles/iptrunk_migration/tasks/compile_template.yaml
+++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/compile_template.yaml
@@ -20,7 +20,17 @@
     mode: '0755'
   delegate_to: localhost
 
-- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
+- name: Print template for the old node "{{ old_node_fqdn }}" in "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
+  ansible.builtin.template:
+    src: "{{ old_node_vendor }}/{{ config_object }}.j2"
+    dest: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
+    lstrip_blocks: true
+    trim_blocks: true
+    mode: '0755'
+  delegate_to: localhost
+  when: (verb == "delete" or verb == "deactivate") and inventory_hostname != new_node.router.router_fqdn
+
+- name: Print template for the new node in "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
   ansible.builtin.template:
     src: "{{ new_node.router.vendor }}/{{ config_object }}.j2"
     dest: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
@@ -28,6 +38,7 @@
     trim_blocks: true
     mode: '0755'
   delegate_to: localhost
+  when: (verb == "deploy") and inventory_hostname == new_node.router.router_fqdn
 
 - name: Set netconf connection for trunk nodes
   ansible.builtin.include_tasks: set_netconf_connection.yaml