diff --git a/lib/ansible/modules/remote_management/foreman/katello.py b/lib/ansible/modules/remote_management/foreman/katello.py index 86b7be0622..5679ad229d 100644 --- a/lib/ansible/modules/remote_management/foreman/katello.py +++ b/lib/ansible/modules/remote_management/foreman/katello.py @@ -245,7 +245,7 @@ class NailGun(object): e = get_exception() if "Import is the same as existing data" in e.message: - return True + return False else: self._module.fail_json(msg="Manifest import failed with %s" % e) @@ -308,7 +308,7 @@ class NailGun(object): formatted_name = [params['name'].replace('(', '').replace(')', '')] formatted_name.append(params['basearch']) - if params['releasever']: + if 'releasever' in params: formatted_name.append(params['releasever']) formatted_name = ' '.join(formatted_name) @@ -319,7 +319,10 @@ class NailGun(object): repository = repository.search() if len(repository) == 0: - reposet.enable(data={'basearch': params['basearch'], 'releasever': params['releasever']}) + if 'releasever' in params: + reposet.enable(data={'basearch': params['basearch'], 'releasever': params['releasever']}) + else: + reposet.enable(data={'basearch': params['basearch']}) return True