added a check before applying the role
@@ -164,6 +164,10 @@ def hashivault_iam_role_create(params):
value = params.get(arg)
if value is not None:
kwargs[arg] = value
+
+ if client.get_role(role_name=name, mount_point='aws'):
+ return {'changed': False}
+ else:
client.create_role(name, mount_point='aws', **kwargs)
return {'changed': True}
