---
- name: get aws volume IDs
hosts: localhost
gather_facts: false
become: false
vars:
aws_volume: {
changed: false,
failed: false,
volumes: [
{
attachment_set: [],
create_time: "2019-05-30T15:49:14.238000+00:00",
encrypted: false,
id: "vol-xxxxxxxxxx",
iops: 100,
region: "us-east-1",
size: 32,
snapshot_id: "snap-xxxxxxxx",
status: "available",
tags: {
Backup: "false",
Environment: "PROD",
Name: "app2",
Zone: "1C"
},
type: "gp2",
zone: "us-east-1c"
},
{
attachment_set: [],
create_time: "2019-07-18T18:06:16.555000+00:00",
encrypted: false,
id: "vol-xxxxxxxxx",
iops: 100,
region: "us-east-1",
size: 32,
snapshot_id: "snap-xxxxxxxxxxxx",
status: "available",
tags: {
Backup: "true",
Environment: "PROD",
Name: "app1"
},
type: "gp2",
zone: "us-east-1c"
}
]
}
tasks:
- name: get volume IDs from JSON list
set_fact:
vol_ids: "{{ aws_volume.volumes | json_query('[].id') | list }}"
- name: show volume IDs
debug: var=vol_ids
PLAY [get aws volume IDs] **********************************************************************************************
TASK [get volume IDs from JSON list] ***********************************************************************************
ok: [localhost]
TASK [show volume IDs] *************************************************************************************************
ok: [localhost] => {
"vol_ids": [
"vol-xxxxxxxxxx",
"vol-xxxxxxxxx"
]
}
PLAY RECAP *************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGUDtnkSQxnygkCzH599qOWPNFmrEkVgMAC0UrcvEA7-a7u2aQ%40mail.gmail.com.
--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGUDtnmTWBvTZGUD2RG4kSAxv6WgDM637sFFb8kkX1Aid5t5kg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/F8247068-62C6-4BC5-BBD6-812D7996E9DF%40nist.gov.
--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGUDtnmaJLW_9d1UNukaR-amduefyoSRqz_K0s1qFB8bg7aSRg%40mail.gmail.com.
--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5A86F82A-43E2-4740-AFE7-E51C23031090%40nist.gov.
--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/66aa2a97-3063-8dad-c705-662d1882c210%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGUDtnk0GAaR0LzSaDp-_25LcLFguh5ehowoVroDdGkkt0EZeA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/F0108281-263B-47B1-80E2-AC404778644C%40nist.gov.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4703F454-2806-4D56-9C24-2BCBD5882B3A%40nist.gov.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGUDtn%3DQTOn6HCHjDyicTAoDzdQQPt4tU3a8vKbrA5Rzz9cuUg%40mail.gmail.com.
On Jan 5, 2023, at 11:53 AM, SysAdmin EM <ema...@gmail.com> wrote:
Thanks. I’m ashamed I hope you can forgive me for bothering so much.
--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGUDtn%3DqmcPmz2iibjc5dYdXjZ-EnQ2it3ynCDwrm_h4DHO5jQ%40mail.gmail.com.