Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
You were right Jordan. I have to say, I really dislike the use of quotes here. It is really not intuitive what data you are passing. Thanks for everyone's help. On Monday, 12 August 2019 08:11:29 UTC+1, Richard Payne wrote: > > I thought so, but will try again to confirm. > > On Friday, 9 August 2019 21:03:03 UTC+1, Jordan Borean wrote: >> >> No you are not, the jinja2 block is evaluated before it’s passed to the >> module so the data will contain the array you are looking for. Did you try >> it out? > > -- 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/2f07d9c4-fb7b-45a8-8f5d-4857177d834b%40googlegroups.com.
Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
I thought so, but will try again to confirm. On Friday, 9 August 2019 21:03:03 UTC+1, Jordan Borean wrote: > > No you are not, the jinja2 block is evaluated before it’s passed to the > module so the data will contain the array you are looking for. Did you try > it out? -- 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/fc324560-2067-4d4d-a46c-0d82583fcfd5%40googlegroups.com.
Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
No you are not, the jinja2 block is evaluated before it’s passed to the module so the data will contain the array you are looking for. Did you try it out? -- 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/440859b6-c3cc-42ae-8cb5-04a2074705eb%40googlegroups.com.
Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
On Thursday, 8 August 2019 09:55:58 UTC+1, Kai Stian Olstad wrote: > > On 08.08.2019 10:50, 'Richard Payne' via Ansible Project wrote: > > Hi Kai > > > > This: > > Port: {{ range(43000,43200) | list }} > > > > produces: > > ERROR! Syntax Error while loading YAML. > >found unacceptable key (unhashable type: 'AnsibleMapping') > > The offending line appears to be: > > > > > > HostName: "+" > > Port: {{ range(43000,43200) | list }} > > ^ here > > We could be wrong, but this one looks like it might be an issue with > > missing quotes. Always quote template expression brackets when they > > start a value. For instance: > > As the error message says you need to add quotes. > When a { comes after a colon you need to quote it with single or double > quotes. > > Port: "{{ range(43000,43200) | list }}" > > > -- > Kai Stian Olstad > Sure, but then I'm passing a single string to an int array. -- 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/78ef4a39-327f-4206-9461-d9c102c214c5%40googlegroups.com.
Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
On 08.08.2019 10:50, 'Richard Payne' via Ansible Project wrote: > Hi Kai > > This: > Port: {{ range(43000,43200) | list }} > > produces: > ERROR! Syntax Error while loading YAML. >found unacceptable key (unhashable type: 'AnsibleMapping') > The offending line appears to be: > > > HostName: "+" > Port: {{ range(43000,43200) | list }} > ^ here > We could be wrong, but this one looks like it might be an issue with > missing quotes. Always quote template expression brackets when they > start a value. For instance: As the error message says you need to add quotes. When a { comes after a colon you need to quote it with single or double quotes. Port: "{{ range(43000,43200) | list }}" -- Kai Stian Olstad -- 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/9fef91cf-22ab-f473-e587-265df3c0b33c%40olstad.com.
Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
Hi Kai This: Port: {{ range(43000,43200) | list }} produces: ERROR! Syntax Error while loading YAML. found unacceptable key (unhashable type: 'AnsibleMapping') The offending line appears to be: HostName: "+" Port: {{ range(43000,43200) | list }} ^ here We could be wrong, but this one looks like it might be an issue with missing quotes. Always quote template expression brackets when they start a value. For instance: with_items: - {{ foo }} Should be written as: with_items: - "{{ foo }}" So I removed the interpolation: Port: range(43000,43200) | list which produces: fatal: [dev21-sfapp12]: FAILED! => {"changed": false, "module_version": "1.0.1", "msg": "Convert property 'Port' value from type 'STRING[]' to type 'SINT32[]' failed\r\n At line:11, char:2\r\n Buffer:\r\n Protocol = \"http\";\n};^\n\ninsta\r\n", "reboot_required": false} Any thoughts? On Thursday, 8 August 2019 09:00:37 UTC+1, Kai Stian Olstad wrote: > > On 08.08.2019 09:19, 'Richard Payne' via Ansible Project wrote: > > Thanks Jordan, but a explicitly written list is not really practical > when > > you have a range 100 or 1000 in length. > > {{ range(46000,46100) | list }} > > > -- > Kai Stian Olstad > -- 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/f2eea202-9dc3-49ff-85e8-ba4c38f73242%40googlegroups.com.
Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
Ahh sorry I thought you only wanted those numbers. The suggestion above should work. -- 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/114272c5-e3e1-402f-b124-59eb5f2e250c%40googlegroups.com.
Re: [ansible-project] Re: win_dsc UrlAcl and passing int[]
On 08.08.2019 09:19, 'Richard Payne' via Ansible Project wrote: > Thanks Jordan, but a explicitly written list is not really practical when > you have a range 100 or 1000 in length. {{ range(46000,46100) | list }} -- Kai Stian Olstad -- 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/27de2509-144c-b489-6800-0e2b6047231a%40olstad.com.
[ansible-project] Re: win_dsc UrlAcl and passing int[]
Thanks Jordan, but a explicitly written list is not really practical when you have a range 100 or 1000 in length. On Wednesday, 7 August 2019 21:21:48 UTC+1, Jordan Borean wrote: > > You should be using a YAML list or a Python list like the below; > > Port: > - 46000 > - 46100 > > # or > > Port: [46000, 46100] > > Thanks > > Jordan > -- 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/eb17c4e0-7b9b-4a1f-96f2-0a66a023d675%40googlegroups.com.
[ansible-project] Re: win_dsc UrlAcl and passing int[]
You should be using a YAML list or a Python list like the below; Port: - 46000 - 46100 # or Port: [46000, 46100] Thanks Jordan -- 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/529d0dd6-3ea5-4b39-997b-89948510581c%40googlegroups.com.