Ubuntu sets the default runlevel in /etc/init/rc-sysinit.conf and it should be set to 2 on Ubuntu systems. The Ansible task will verify that the correct runlevel is set. If the verification fails, an error will be printed and the playbook will fail.
/etc/init/rc-sysinit.conf
2