diff --git a/library/packaging/apt_key b/library/packaging/apt_key index 7c1ba2e265b..0a483a97bbc 100644 --- a/library/packaging/apt_key +++ b/library/packaging/apt_key @@ -254,7 +254,7 @@ def main(): keys2 = all_keys(module, keyring, short_format) if len(keys) != len(keys2): changed=True - if key_id and not key_id in keys2: + if key_id and not key_id[-16:] in keys2: module.fail_json(msg="key does not seem to have been added", id=key_id) module.exit_json(changed=changed) elif state == 'absent':