From f9b44990829c5d17d1ee5f0cb4a5dcc16bcc1aca Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sun, 14 May 2017 13:11:23 -0400 Subject: [PATCH] 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 # This was originally fixed and found in the Ansible Puppet role which is maintained by the OpenStack infrastructure team. https://github.com/openstack-infra/ansible-role-puppet/commit/8d0f0bfd0a7288b4bdc2782ed2d1dcf626e8a3ba --- lib/ansible/modules/system/puppet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/puppet.py b/lib/ansible/modules/system/puppet.py index 602f4bda106..7d33ea43e22 100644 --- a/lib/ansible/modules/system/puppet.py +++ b/lib/ansible/modules/system/puppet.py @@ -169,7 +169,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),