Set facts type to dict

With newer versions of ansible, module arguments are assumed to
be strings unless otherwise specified.  Our 'facts' argument is
expected to be a dictionary, so tell ansible that.

Without this, the argument will arrive as a string and be written
to the facter file inside string quotes.  Facter will produce the
following error:

  undefined method `each' for #<String:0x000000016ee640>

This was originally fixed and found in the Ansible Puppet role which
is maintained by the OpenStack infrastructure team.

8d0f0bfd0a
pull/24764/head
Mohammed Naser 9 years ago committed by Brian Coca
parent cc18296cc5
commit a43374ed32

@ -162,7 +162,7 @@ def main():
show_diff=dict(
# internal code to work with --diff, do not use
default=False, aliases=['show-diff'], type='bool'),
facts=dict(default=None),
facts=dict(default=None, type='dict'),
facter_basename=dict(default='ansible'),
environment=dict(required=False, default=None),
certname=dict(required=False, default=None),

Loading…
Cancel
Save