Commit Graph
8 Commits
Author SHA1 Message Date
Richard Bywater 5e5790e7d1 Use correct source_vars syntax 2018-02-05 12:45:52 +13:00
Richard Bywater 9f8b9b8d7f Fix unit test 2018-02-05 08:55:10 +13:00
Richard Bywater 6d69087db8 Add prefer_ipv4 to whitelist and add unit test for config value 2018-02-05 08:55:10 +13:00
Richard Bywater a737663dde Add ability to select to prefer IPv4 addresses for ansible_ssh_host
Currently Cloudforms can return a mix of IPv4 and IPv6 addresses in the
ipaddresses field and this mix comes in a "random" order (that is the
first entry may be IPv4 sometimes but IPv6 other times). If you wish to
always use IPv4 for the ansible_ssh_host value then this is problematic.

This change adds a new prefer_ipv4 flag which will look for the first
IPv4 address in the ipaddresses list and uses that instead of just the
first entry.
2018-02-05 08:55:10 +13:00
Richard Bywater b8c76301de Add validation to ensure leading fullstop for suffix 2018-01-17 13:20:59 +13:00
Richard Bywater b5db652050 Clarify that leading fullstop needed 2018-01-14 14:05:34 +13:00
Richard Bywater 9b05a41eec Add ability to append suffix to host names for Cloudforms Inventory
Allows for use of a suffix that will be appended to host names returned
from Cloudforms API if that suffix is not present.

For example with a suffix of 'example.org', the following results would
be shown for a particular Cloudforms host name:
someexample -> someexample.example.org
someexample.example.org -> someexample.example.org

The main use-case for this is, when one Inventory Source is returning
names that have a FQDN name whilst others are returning a shortname, to
ensure that the hosts in an inventory aren't effectively duplicated.
2017-12-05 14:47:33 +13:00
Richard Bywater 079abc162f Fix CloudForms enabled & id variable names
On Cloudforms (Version 2.0 at least), the dictionary that gets passed to
the inventory_import has a top-level 'cloudforms' dictionary element
that contains the 'id' and 'power_state' rather than those elements
being at the top-level of the dictionary.

This change adds in the 'cloudforms' into the expected name.
2017-11-30 09:30:23 +13:00