# Problem ansible with Keycloak API

**URL:** <https://forum.keycloak.org/t/problem-ansible-with-keycloak-api/22464>\
**Category:** Configuring the server\
**Created:** [June 2, 2023, 1:22pm UTC](https://forum.keycloak.org/t/problem-ansible-with-keycloak-api/22464 "2023-06-02T13:22:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fred](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@fred](https://forum.keycloak.org/u/fred)\
**Post date:** [June 2, 2023, 1:22pm UTC](https://forum.keycloak.org/t/problem-ansible-with-keycloak-api/22464/1 "2023-06-02T13:22:11Z")

</div>

Hello,  
I use ansible for manage my User Federation with Keycloak API  
It’s OK for create ldap user federation.  
But when i want add Mappers with group-ldap-mapper it’s KO.  
There is my task which failed:

- name: keycloak add mapper ldap  
delegate\_to: localhost  
uri:  
url: “{{ url }}”/{{ id of user federation }}  
method: PUT  
body\_format: json  
headers:  
Content-Type: application/json  
Authorization: Bearer {{ secret }}  
body:  
name: test  
parentId: ldap  
providerId: group-ldap-mapper  
providerType: org.keycloak.storage.ldap.mappers.LDAPStorageMapper  
config:  
groups.dn: [“ou=test,ou=test”]  
mode: [“READ\_ONLY”]

Failed with status code 500.  
Can you help me please?
