diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py index 466d7cbfaee..a3752101729 100644 --- a/lib/ansible/galaxy/role.py +++ b/lib/ansible/galaxy/role.py @@ -237,7 +237,7 @@ class GalaxyRole(object): else: self.version = 'master' elif self.version != 'master': - if role_versions and self.version not in [a.get('name', None) for a in role_versions]: + if role_versions and str(self.version) not in [a.get('name', None) for a in role_versions]: raise AnsibleError("- the specified version (%s) of %s was not found in the list of available versions (%s)." % (self.version, self.name, role_versions)) tmp_file = self.fetch(role_data)