It says malformed json, so that's pretty obvious. Try running with -v to (hopefully) see what's being posted as json and there should be your solution.
Sent from Gmail Mobile On Thu, 14 Sep 2023 at 19:09, Tony Wong <tdubb...@gmail.com> wrote: > any idea why I keep getting this error with this pb? > > --- > - name: "Create UUID Pool" > vars: > api_info: &api_info > api_private_key: "{{ api_private_key }}" > api_key_id: "{{ api_key_id }}" > api_uri: "{{ api_uri | default(omit) }}" > validate_certs: "{{ validate_certs | default(omit) }}" > state: "{{ state | default(omit) }}" > > cisco.intersight.intersight_rest_api: > <<: *api_info > resource_path: /uuidpool/Pools > query_params: > $filter: "Name eq '{{ item.name_of_uuid_pool }}'" > api_body: { > "Name": "{{ item.name_of_uuid_pool }}", > "Description": "{{ item.name_of_uuid_pool }}", > "Organization": { > "Moid": "{{ intersight_org.api_response.Moid }}" > }, > Tags: [{Key: "configmode", Value: "ansible"}, {Key: "prefix", Value: "{{ > prefix }}"}], > > "AssignmentOrder": "default", > "Prefix": "{{ item.uuid_prefix }}", > "UuidSuffixBlocks": [ > { > "From": "{{ item.uuid_from }}", > "Size": "{{ item.uuid_size }}" > } > ] > } > loop: "{{ uuid_pools }}" > register: uuid_pool_result > > TASK [create_pools : Create UUID Pool] > ************************************************************** > failed: [localhost] (item={'name_of_uuid_pool': 'UUID Pool 1', > 'uuid_prefix': '00000000-0000-0000', 'uuid_size': 100, 'uuid_from': > '0000-000000000001'}) => {"ansible_loop_var": "item", "changed": false, > "item": {"name_of_uuid_pool": "UUID Pool 1", "uuid_from": > "0000-000000000001", "uuid_prefix": "00000000-0000-0000", "uuid_size": > 100}, "msg": "API error: (400, 'HTTP Error 400: Bad Request', > b'{\"code\":\"InvalidRequest\",\"message\":\"Cannot execute the request. > The JSON document is > malformed.\",\"messageId\":\"barcelona_request_malformed_json\",\"traceId\":\"MITgFj7I9LY9WhE3CmsPWPyfXM6nIqWYFeeBrGUXx5cHPLBhZNY8sg==\",\"cause\":{\"code\":\"InternalServerError\",\"message\":\"Cannot > execute the request due to an error. Retry > later.\",\"messageId\":\"barcelona_request_internal_error\",\"traceId\":\"MITgFj7I9LY9WhE3CmsPWPyfXM6nIqWYFeeBrGUXx5cHPLBhZNY8sg==\"}}') > "} > failed: [localhost] (item={'name_of_uuid_pool': 'UUID Pool 2', > 'uuid_prefix': '11111111-1111-1111', 'uuid_size': 50, 'uuid_from': > '1111-111111111101'}) => {"ansible_loop_var": "item", "changed": false, > "item": {"name_of_uuid_pool": "UUID Pool 2", "uuid_from": > "1111-111111111101", "uuid_prefix": "11111111-1111-1111", "uuid_size": 50}, > "msg": "API error: (400, 'HTTP Error 400: Bad Request', > b'{\"code\":\"InvalidRequest\",\"message\":\"Cannot execute the request. > The JSON document is > malformed.\",\"messageId\":\"barcelona_request_malformed_json\",\"traceId\":\"uCoQYEn3PXD6v9QT6d8Nz3KDNGP_7KrDsa3Gnz75YuuXecj5ALedPw==\",\"cause\":{\"code\":\"InternalServerError\",\"message\":\"Cannot > execute the request due to an error. Retry > later.\",\"messageId\":\"barcelona_request_internal_error\",\"traceId\":\"uCoQYEn3PXD6v9QT6d8Nz3KDNGP_7KrDsa3Gnz75YuuXecj5ALedPw==\"}}') > "} > > > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ansible-project+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/9773485e-c61c-481a-8f32-03240f8b045an%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/9773485e-c61c-481a-8f32-03240f8b045an%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF8BbLabg-JUcVAnJH93qGnGSga%2BXwFx3OvfVE_1zb_msfPOOw%40mail.gmail.com.