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.
Merge pull request #1201 from edx/jarv/diff-and-check

Jarv/diff and check