Skip to content

Commit

Permalink
inventory: add v6_main_ip to attributes (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
resmo committed Jan 15, 2023
1 parent f04f721 commit 679573a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/inventory-ipv6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- inventory - Added IPv6 support by adding ``v6_main_ip`` to the attributes and improved docs (https://github.com/vultr/ansible-collection-vultr/pull/54).
11 changes: 11 additions & 0 deletions plugins/inventory/vultr.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
- plan
- hostname
- main_ip
- v6_main_ip
filters:
description:
- Filter hosts with Jinja2 templates.
Expand Down Expand Up @@ -125,6 +126,16 @@
plugin: vultr.cloud.vultr
compose:
ansible_host: vultr_main_ip
# Respectively for IPv6:
plugin: vultr.cloud.vultr
compose:
ansible_host: vultr_v6_main_ip
# Prioritize IPv6 over IPv4 if available.
plugin: vultr.cloud.vultr
compose:
ansible_host: vultr_v6_main_ip or vultr_main_ip
"""

RETURN = r""" # """
Expand Down

0 comments on commit 679573a

Please sign in to comment.