conditional var expansion for sync_nodes_optional