I’m trying to run an ansible playbook in my STORE server to create a Zimbra Account with certain privileges but I’m getting the same error all the time.
fatal: [server-store]: FAILED! => {"cache_control": "no-store, no-cache", "changed": false, "connection": "close", "content_length": "536", "content_type": "text/xml;charset=utf-8", "date": "Wed, 26 Jun 2024 07:11:08 GMT", "elapsed": 0, "msg": "Status code was 500 and not [200]: HTTP Error 500: Server Error", "redirected": false, "status": 500, "url": "https://server:7071/service/admin/soap"}
The thing is that at first the playbook extracts the token of the admin account to then perform some actions, and even sometimes that throws the same error, what makes me think that might be an error with the Zimbra accounts config. I leave here a small part of the playbook where I’m getting the error but when I try to perform the same action but just with a normal account I don’t have any problems.
- name: Create Zimbra User
uri:
url: "url"
method: POST
validate_certs: false
headers:
Content-Type: "text/xml"
SOAPAction: "urn:zimbraAdmin"
body: |
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<format type="xml"/>
<authToken>{{ auth_token }}</authToken>
</context>
</soap:Header>
<soap:Body>
<CreateAccountRequest xmlns="urn:zimbraAdmin">
<name>{{ mail }}</name>
<password>{{ generated_password }}</password>
<a n="zimbraAccountStatus">active</a>
<a n="displayName">{{ formatted_username }}</a>
<a n="zimbraHideInGal">TRUE</a>
<a n="zimbraFeatureAdminMailEnabled">TRUE</a>
<a n="zimbraIsDelegatedAdminAccount">TRUE</a>
<a n="zimbraPrefAdminConsoleWarnOnExit">TRUE</a>
<a n="zimbraFeatureGalAutoCompleteEnabled">TRUE</a>
<a n="zimbraFeatureGalEnabled">FALSE</a>
<a n="zimbraFeatureGalSyncEnabled">FALSE</a>
<a n="zimbraGalSyncAccountBasedAutoCompleteEnabled">FALSE</a>
<a n="zimbraPrefGalAutoCompleteEnabled">FALSE</a>
<a n="zimbraPrefGalSearchEnabled">FALSE</a>
<a n="zimbraPasswordMustChange">TRUE</a>
<!-- Otros atributos opcionales pueden ir aquí -->
</CreateAccountRequest>
</soap:Body>
</soap:Envelope>
status_code: 200