You can create a temporary variable to store both region and register value
and then access that in subsequent tasks.
For example,
...
vars:
vpcs:
a: 1
...
tasks:
- name: Update register variable
set_fact:
new_vpcs: "{{ vpcs | combine({'region': 'us-east-1' }) }}"
...
On Mon, Jul 11, 2022 at 1:52 PM Akshay Jadhav <[email protected]> wrote:
> Hi,
>
> I want to use region attribute from below task for subsequent task but
> that attribute is not a part of output , so how I can use it next tasks.
> - name: get aws vpc details
> ec2_vpc_net_info:
> aws_access_key: ##########
> aws_secret_key: #########
> region: us-east-1
> register: aws_output
>
> Region is input to the given module so I want to print that region. Please
> guide me how to print region its not a part of register. Thank you.
>
> --
> 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/33d5febb-bfcf-4a4f-8046-e38b45ca04c6n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/33d5febb-bfcf-4a4f-8046-e38b45ca04c6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Thanks,
Abhijeet Kasurde
--
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/CAFwWkHqi5%2BAFGgn-69206Bg5LUvQ6aB1-uK2fo4QAcAhFN18QQ%40mail.gmail.com.