Open danwashusen opened 2 years ago
The docs don't really mention how the various ansible_ec2_network_interfaces_macs_mac* facts work (e.g. the 'mac' part is expanded). To use the facts one needs build a variable name dynamically which requires a bit of trial and error to use...
ansible_ec2_network_interfaces_macs_mac*
A few simple examples would go a long way:
{{ lookup('vars', 'ansible_ec2_network_interfaces_macs_' + (ansible_ec2_mac | replace(':', '_')) + '_subnet_ipv4_cidr_block') }}
Documentation Report
amazon.aws.ec2_metadata_facts
$ ansible --version ansible [core 2.12.0] config file = None configured module search path = ['/home/danwas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible ansible collection location = /home/danwas/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.9.5 (default, May 11 2021, 08:20:37) [GCC 10.3.0] jinja version = 3.0.3 libyaml = True
$ ansible-galaxy collection list Collection Version ----------------- ------- amazon.aws 2.0.0 ansible.posix 1.3.0 community.aws 2.0.0 community.docker 1.10.0 community.general 3.7.0
$ ansible-config dump --only-changed
Ubuntu 20.04
No response
Hi @danwashusen More docs would definitely be great, would you be interested in opening a PR to add some examples of things that you've found useful?
Summary
The docs don't really mention how the various
ansible_ec2_network_interfaces_macs_mac*
facts work (e.g. the 'mac' part is expanded). To use the facts one needs build a variable name dynamically which requires a bit of trial and error to use...A few simple examples would go a long way:
Issue Type
Documentation Report
Component Name
amazon.aws.ec2_metadata_facts
Ansible Version
Collection Versions
Configuration
OS / Environment
Ubuntu 20.04
Additional Information
No response
Code of Conduct