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
This commit is contained in:
Mohammed Naser 2017-05-14 13:11:23 -04:00 committed by Brian Coca
parent fdcad0f44d
commit f9b4499082

View file

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