Looks like the reference to snapshot_id should be:
set_fact:
snap_id: "{{ show_id_snapshot.results[0].snapshot_id }}"
or to get a list if there are multiples:
set_fact:
snap_id: {{ show_id_snapshot.results | json_query('[].snapshot_id') | list }}
Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123
On Jan 5, 2023, at 11:24 AM, SysAdmin EM <[email protected]> wrote:
registered output here
https://pastebin.pl/view/b43d2333<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.pl%2Fview%2Fb43d2333&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNX%2F5xYY3cTIWIdOyGNMU5MciB5v%2BkMNCfzfeUe4P5U%3D&reserved=0>
On Thu, Jan 5, 2023 at 1:05 PM 'Rowe, Walter P. (Fed)' via Ansible Project
<[email protected]<mailto:[email protected]>>
wrote:
Change this:
- name: "mostrando"
debug: var=show_id_snapshot.snapshot_id
to
- name: "mostrando"
debug: var=show_id_snapshot
so we can see the entirety of what is registered.
Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123
On Jan 5, 2023, at 10:53 AM, SysAdmin EM
<[email protected]<mailto:[email protected]>> wrote:
Ok, the output shows me what I have been showing in previous answers.
Here my playbook
---
- name: "Volumenes sin usar"
hosts: localhost
gather_facts: yes
vars:
aws_volume_id:
- vol-xxxxxxxxxxxxx
tasks:
- name: "Creando snapshot desde el volumen"
amazon.aws.ec2_snapshot:
volume_id: "{{ item }}"
wait_timeout: 900
snapshot_tags:
MarkedForDeletion: true
register: show_id_snapshot
with_items: "{{ aws_volume_id }}"
- name: "mostrando"
debug: var=show_id_snapshot.snapshot_id
Here the debug
https://pastebin.pl/view/20bf3d1e<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.pl%2Fview%2F20bf3d1e&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=UrrEwpc45MFeQgDqN%2BsAT5BPsOANhVW%2FNiOda9rkeFU%3D&reserved=0>
will I be using some reserved word? I don’t understand where the problem is the
key exists in the command output.
On Thu, Jan 5, 2023 at 12:43 PM 'Rowe, Walter P. (Fed)' via Ansible Project
<[email protected]<mailto:[email protected]>>
wrote:
- name: "mostrando"
debug:
msg: var=show_id_snapshot
should be
- name: "mostrando"
debug: var=show_id_snapshot
or
- name: "mostrando"
debug:
var: show_id_snapshot
or
- name: "mostrando"
debug:
msg: "{{ show_id_snapshot }}"
Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123
On Jan 5, 2023, at 10:41 AM, SysAdmin EM
<[email protected]<mailto:[email protected]>> wrote:
i Try this tasks:
---
- name: "Volumenes sin usar"
hosts: localhost
gather_facts: yes
vars:
aws_volume_id:
- vol-xxxxxxxxxxxxxxxx
tasks:
- name: "Creando snapshot desde el volumen"
amazon.aws.ec2_snapshot:
volume_id: "{{ item }}"
wait_timeout: 900
snapshot_tags:
MarkedForDeletion: true
register: show_id_snapshot
with_items: "{{ aws_volume_id }}"
- name: "mostrando"
debug:
msg: var=show_id_snapshot
All debug is here:
https://pastebin.pl/view/eb4b1e29<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.pl%2Fview%2Feb4b1e29&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=nF2FWruLEzW6Ox9hXRUOenM52UZhFlNBKwpXRSJcbHo%3D&reserved=0>
Thanks for the help.
On Thu, Jan 5, 2023 at 12:38 PM Todd Lewis
<[email protected]<mailto:[email protected]>> wrote:
The register worked fine, but there's a typo in your debug task, which you have
not shown us.
On 1/5/23 10:30 AM, SysAdmin EM wrote:
I don’t know what I’m doing wrong, I’m desperate.
any help?
On Thu, Jan 5, 2023 at 12:13 PM SysAdmin EM
<[email protected]<mailto:[email protected]>> wrote:
ok: [localhost] => {
"msg": "var=snapshotid\""
}
i think the "register" not 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
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/66aa2a97-3063-8dad-c705-662d1882c210%40gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F66aa2a97-3063-8dad-c705-662d1882c210%2540gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=N5%2BCXt63aZOXlL4mlK8kN7Nw30183rWOW%2FvCbnRogl0%3D&reserved=0>.
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAGUDtnk0GAaR0LzSaDp-_25LcLFguh5ehowoVroDdGkkt0EZeA%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAGUDtnk0GAaR0LzSaDp-_25LcLFguh5ehowoVroDdGkkt0EZeA%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1ZWBsHfOB5uCQzT1AlDlrr57%2BMrpK0BAlt0YiUQCHjw%3D&reserved=0>.
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/F0108281-263B-47B1-80E2-AC404778644C%40nist.gov<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FF0108281-263B-47B1-80E2-AC404778644C%2540nist.gov%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EC54H27wbjJtFgwV0PV4UqMxCerFkCKD%2BBXvTAjtCFo%3D&reserved=0>.
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAGUDtn%3DHiKkN00Dk_uddy6X_1wjnz0jdeDt%3DO_KyhidJ-W%3Dp_w%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAGUDtn%253DHiKkN00Dk_uddy6X_1wjnz0jdeDt%253DO_KyhidJ-W%253Dp_w%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=elr7KXUF2wlDeDZ%2B%2Fes7m8qPkwtPkuKn5KEc22TDUSE%3D&reserved=0>.
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/4703F454-2806-4D56-9C24-2BCBD5882B3A%40nist.gov<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F4703F454-2806-4D56-9C24-2BCBD5882B3A%2540nist.gov%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=26FR6YCJ7nSgAWrhcg2l5uHOpHo3bX5lJyJCvgUTXMk%3D&reserved=0>.
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAGUDtn%3DQTOn6HCHjDyicTAoDzdQQPt4tU3a8vKbrA5Rzz9cuUg%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAGUDtn%253DQTOn6HCHjDyicTAoDzdQQPt4tU3a8vKbrA5Rzz9cuUg%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C9cd95c9a11e84ad05e8608daef396af6%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638085327136954230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MI2qQSOlTgKAe101FDJTgWS0frknbaXjJxW2qTXROiU%3D&reserved=0>.
--
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/B361E346-5085-40D3-A417-282C4175D865%40nist.gov.