FIX: Added 'sudo' to apt_repository task and 'when' clause to only run when apt_repositories is defined.