diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml b/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml
index bdcbc44cc108bf4670cabceb464d46e7a7b6d390..6de46b5a2abd16c310732f7d6eb94c65f2c545e1 100644
--- a/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml
+++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml
@@ -21,14 +21,6 @@
opid: "{{ lookup('community.general.random_string', length=18, special=false) }}"
config_is_different: "False"
-- name: Lets take a look at trunk
- ansible.builtin.debug:
- msg: "{{ wfo_trunk }}"
-
- # - name: Lets take a look at trunk
- # ansible.builtin.debug:
- # msg: "{{ trunks[0] }}"
-
- name: The old node is
ansible.builtin.debug:
msg: "{{ old_node }}"
@@ -62,26 +54,23 @@
ansible.builtin.debug:
msg: "{{ opid }}"
-- name: Include compiling the template
+- name: Include compiling the template for the old node
ansible.builtin.include_tasks: compile_template.yaml
- when: verb == "deactivate" and inventory_hostname == old_node
-
-- name: Include compiling the template
- ansible.builtin.include_tasks: compile_template.yaml
- when: verb == "delete" and inventory_hostname == old_node
+ when: (verb == "deactivate" or verb == "delete")
+ and inventory_hostname == old_node
-- name: Include compiling the template
- ansible.builtin.include_tasks: compile_template.yaml
- when: verb == "deploy" and inventory_hostname == new_node.router.router_fqdn
-
-- name: Include the modification tasks if specified
+- name: Include deactivation tasks for the old node
ansible.builtin.include_tasks: deactivate_trunk_side.yaml
when: verb == "deactivate" and inventory_hostname == old_node
-- name: Include the removal tasks if specified
+- name: Include removal tasks for the old node
ansible.builtin.include_tasks: delete_trunk_side.yaml
when: verb == "delete" and inventory_hostname == old_node
+- name: Include compiling the template for the new node
+ ansible.builtin.include_tasks: compile_template.yaml
+ when: verb == "deploy" and inventory_hostname == new_node.router.router_fqdn
+
- name: Include the deployment tasks if specified
ansible.builtin.include_tasks: deploy_object.yaml
when: verb == "deploy" and inventory_hostname == new_node.router.router_fqdn