'Run check mode'

def check(self):

    changed = False
    try:
        if ((self.state == 'present') and self.exists()):
            if (self.fail_mode and (self.fail_mode != self.get_fail_mode())):
                changed = True
            current_external_ids = self.get_external_ids()
            exp_external_ids = self.module.params['external_ids']
            if (exp_external_ids is not None):
                for (key, value) in exp_external_ids:
                    if ((key in current_external_ids) and (value != current_external_ids[key])):
                        changed = True
                for (key, value) in current_external_ids.items():
                    if (key not in exp_external_ids):
                        changed = True
        elif ((self.state == 'absent') and self.exists()):
            changed = True
        elif ((self.state == 'present') and (not self.exists())):
            changed = True
    except Exception:
        earg = get_exception()
        self.module.fail_json(msg=str(earg))
    self.module.exit_json(changed=changed)
