0

I tried to upload an openstack image with ansible. The task failed with

Failed validating 'type' in schema['properties']['tags']:: 400 Bad Request: On instance['tags']:: u"['testtag']": 'items': {'maxLength': 255, 'type': 'string'},: 'type': 'array'}: Provided object does not match schema 'image': u"['testtag']" is not of type 'array': {'description': u'List of strings related to the image',",

Here is my ansible task:

- os_image:
    name: test_image
    auth: "{{os_auth}}"
    container_format: bare
    disk_format: raw
    tags: [testtag]
    state: present
    filename: /var/lib/test_image.raw

I have changed it to - testtag1 with new indent line however the error message its showing the quote:

u"['testtag1']" is not of type 'array': Failed validating 'type' in schema['properties']['tags']:: 400 Bad Request: On instance['tags']:: 'items': {'maxLength': 255, 'type': 'string'},: 'type': 'array'}: u"['testtag1']": {'description': u'List of strings related to the image',",
tedli
  • 1
  • 1
  • 1
    Are you 100% sure you pasted the task very exactly as it is in the playbook/role you are running ? From the error, it looks like you have written `tags: "[testtag]"` (with quotes around what should be a yaml shortcut syntax for a list) and that the module is getting a string instead of an array (e.g. list). One thing you can try (in case of a possible bug in the module...) is write your list in "pure" yaml format (i.e. remove brackets around your tag, indent on a new line and prepend with a dash+space (`- testtag`). – Zeitounator May 21 '22 at 07:20
  • I have changed it to - testtag1 with new indent line however the error message its showing the quote like "u"['testtag1']&quot" u"['testtag1']" is not of type 'array': Failed validating 'type' in schema['properties']['tags']:: 400 Bad Request: On instance['tags']:: 'items': {'maxLength': 255, 'type': 'string'},: 'type': 'array'}: u"['testtag1']": {'description': u'List of strings related to the image',", – tedli May 24 '22 at 18:49
  • Please don't describe this in a comment: edit your question. – Zeitounator May 25 '22 at 04:58
  • I got same error. Everything about cloud auth is ok. but i cant create image via ansible. – Aref Jun 06 '22 at 12:18

0 Answers0