Support --check mode for ansible

In order to support --check we need to ensure that registered
vars exist before checking their stdout. Otherwise ansible
errors out.