When i try that i get a syntax error.
fatal: [127.0.0.1]: FAILED! => {
"reason": "Syntax Error while loading YAML.\n did not find expected
'-' indicator\n\nThe error appears to be in
'/home/nbritton/ansible/gts-core-storage-operations/netbackup/tasks/msdp.create.include.yml':
line 78, column 17, but may\nbe elsewhere in the file depending on the
exact syntax problem.\n\nThe offending line appears to be:\n\n
- type: storageServer\n id: 'PureDisk:server'\n
^ here\nThis one looks easy to fix. It seems that there is a value
started\nwith a quote, and the YAML parser is expecting to see the line
ended\nwith the same kind of quote. For instance:\n\n when: \"ok\" in
result.stdout\n\nCould be written as:\n\n when: '\"ok\" in
result.stdout'\n\nOr equivalently:\n\n when: \"'ok' in result.stdout\"\n"
}
On Saturday, December 14, 2019 at 2:35:55 AM UTC-6, Stefan Hornburg (Racke)
wrote:
>
> On 12/14/19 12:46 AM, Nicholas Britton wrote:
> > The problem is I don't know how to make ansible send the right bracket.
> Testing from swagger I know what it expects.
> >
>
> Hello Nicholas,
>
> try to use a list instead of a dict:
>
> data:
> - type: storageServer
> id: 'PureDisk:server.domain'
>
> Regards
> Racke
>
> > On Fri, Dec 13, 2019, 5:16 PM Dick Visser <[email protected]
> <javascript:> <mailto:[email protected] <javascript:>>> wrote:
> >
> > You’re sending something that doesn’t work, and you seem to know
> exactly what the problem is, and also what format
> > _does_ work. So the solution is... send that?
> >
> > Or am I missing something
> >
> >
> >
> > On Fri, 13 Dec 2019 at 22:09, Nicholas Britton <[email protected]
> <javascript:> <mailto:[email protected] <javascript:>>> wrote:
> >
> > I am working on some uri calls with netbackup and with swagger
> shows that it only works with [] but the uri
> > modual is using {}. Any thoughts or tricks to get that to
> format correctly?
> >
> >
> > For example i am sending a body uri body of:
> >
> > |
> > - name: Create MSDP Disk Pool
> > uri:
> > url: "{{baseurl}}storage/disk-pools"
> > method: POST
> > body_format: json
> > status_code: 201
> > headers:
> > authorization: "{{login.json.token}}"
> > content-type: application/vnd.netbackup+json;version=3.0
> > body:
> > data:
> > type: diskPool
> > attributes:
> > name: server_dpm
> > diskVolumes:
> > [name: PureDiskVolume]
> > maximumIoStreams:
> > limitIoStreams: true
> > streamsPerVolume: 75
> > relationships:
> > storageServers:
> > data:
> > type: storageServer
> > id: 'PureDisk:server.domain'
> > validate_certs: no
> > return_content: yes
> > register: dp_create
> >
> > |
> >
> > Which produces this:
> >
> > |
> > "body": {
> > "data": {
> > "attributes": {
> > "diskVolumes": [
> > {
> > "name": "PureDiskVolume"
> > }
> > ],
> > "maximumIoStreams": {
> > "limitIoStreams": true,
> > "streamsPerVolume": 75
> > },
> > "name": "server_dpm"
> > },
> > "relationships": {
> > "storageServers": {
> > "data": {
> > "id": "PureDisk:server.domain",
> > "type": "storageServer"
> > }
> > }
> > },
> > "type": "diskPool"
> > }
> > },
> >
> >
> > |
> >
> > While swagger produces it as this:
> >
> > |
> > working:
> >
> >
> > {
> > "data": {
> > "type": "diskPool",
> > "attributes": {
> > "name": "server_dpm",
> > "diskVolumes": [
> > {
> > "name": "PureDiskVolume"
> > }
> > ],
> >
> > "maximumIoStreams": {
> > "limitIoStreams": true,
> > "streamsPerVolume": 75
> > }
> >
> > },
> > "relationships": {
> > "storageServers": {
> > "data": [
> > {
> > "type": "storageServer",
> > "id": "PureDisk:server.domain"
> > }
> > ]
> > }
> > }
> > }
> > }
> > |
> >
> >
> >
> > --
> > 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
> > [email protected] <javascript:> <mailto:
> [email protected] <javascript:>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/d248f94f-431a-43d7-8ab3-08d9ae619796%40googlegroups.com
>
> > <
> https://groups.google.com/d/msgid/ansible-project/d248f94f-431a-43d7-8ab3-08d9ae619796%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
>
> >
> > --
> > Sent from a mobile device - please excuse the brevity, spelling and
> punctuation.
> >
> > --
> > You received this message because you are subscribed to a topic in
> the Google Groups "Ansible Project" group.
> > To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/Aci8dPvAc1A/unsubscribe.
>
> > To unsubscribe from this group and all its topics, send an email to
> [email protected] <javascript:>
> > <mailto:[email protected] <javascript:>>.
>
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwP%3DaETutURieZSYAD%2B%2B71--zX%2BNHOY4y7EGXLtp98Eozg%40mail.gmail.com
>
> > <
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwP%3DaETutURieZSYAD%2B%2B71--zX%2BNHOY4y7EGXLtp98Eozg%40mail.gmail.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
> > [email protected] <javascript:> <mailto:
> [email protected] <javascript:>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/CAN946jTZfpZShJGx5cTP%3D8KcpzFBoyRkZjt3EcufqyZD3OHSmQ%40mail.gmail.com
>
> > <
> https://groups.google.com/d/msgid/ansible-project/CAN946jTZfpZShJGx5cTP%3D8KcpzFBoyRkZjt3EcufqyZD3OHSmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/8d701573-ee8b-4c5d-955d-542ac9b6ce26%40googlegroups.com.