Topics

Puppet module autofs assistance

J so <jsogood@...>
 

Hello,

I been using a previous version of your module for some time.  I recently upgraded to 5.0.0 and have had little success formatting the data to even get a single Puppet run.  I am using Foreman 1.18RC1 with Puppet 5.3.3.  

'mapfiles' param:

home:
  path: '/etc/auto.home'
  mappings:
  - key: '*'
  - options: 'rw'
  - fs: nfs-1:/home/&

mounts param:

home:
  ensure: present
  mount: '/home'
  mapfile: '/etc/auto.home'
  options: '--timeout=300'

Puppet errors:

Could not retrieve catalog...  ...Autofs::Mapfile[home]:
parameter 'mappings' index 0 expects a value for key 'fs'
parameter 'mappings' index 1 expects a value for key 'key'
parameter 'mappings' index 1 expects a value for key 'fs'
parameter 'mappings' index 0 expects a value for key 'key'

Error: no parameter named 'format' (file:  .../concat/manifests/init.pp, line 94) on Concat_file[/etc/auto.master] ...


Hopefully this is enough to allow an opportunity to be pointed in the right direction.  I have been bashing my brain against this for some time now.

Thanks in advance!


--
Justin Soppe

 


Bollinger, John C
 

Hello Justin,

 

I’m sorry you’re having difficulty.

 

The first problem appears to be with your formatting of the value of the 'mappings' key in the value of the 'mapfiles' parameter.  What is expected is an array of hashes that each one contains both a 'key' and an 'fs', and optionally 'options'.  Instead, you have presented an array of three separate hashes, each with just one key.  You’re close; it looks like what you actually want is this:

 

home:

  ensure: 'present'

  path: '/etc/auto.home'

  mappings:

    - key: '*'

      options: 'rw'

      fs: 'nfs-1:/home/&'

     

That array of hashes syntax always looks a bit weird to me, though.  If you think the same, then you could consider formatting it this way instead, which I think is equivalent:

 

home:

  ensure: 'present'

  path: '/etc/auto.home'

  mappings:

    - { key: '*', options: 'rw', fs: 'nfs-1:/home/&' }

 

===

 

I’m afraid I cannot explain the error about a 'format' parameter to Concat_file[/etc/auto.master], however.  Puppet-autofs does not directly declare any concat_file resources, or provide resource defaults for them, or override any of them (nor should it). Version 5.0.0 does not declare a ‘format’ parameter for _any_ class or resource, and none of its own classes or resources accept such a parameter.

 

If I were to speculate, I’d guess that the error arises from in-scope resource defaults or from a resource override, somewhere among your own local manifests.

 

 

Best regards,

 

John Bollinger

 

 

From: voxpupuli@groups.io [mailto:voxpupuli@groups.io] On Behalf Of J so
Sent: Wednesday, July 11, 2018 3:25 AM
To: voxpupuli@groups.io
Subject: [voxpupuli] Puppet module autofs assistance

 

Hello,

 

I been using a previous version of your module for some time.  I recently upgraded to 5.0.0 and have had little success formatting the data to even get a single Puppet run.  I am using Foreman 1.18RC1 with Puppet 5.3.3.  

 

'mapfiles' param:

 

home:

  path: '/etc/auto.home'

  mappings:

  - key: '*'

  - options: 'rw'

  - fs: nfs-1:/home/&

 

mounts param:

 

home:

  ensure: present

  mount: '/home'

  mapfile: '/etc/auto.home'

  options: '--timeout=300'

 

Puppet errors:

 

Could not retrieve catalog...  ...Autofs::Mapfile[home]:

parameter 'mappings' index 0 expects a value for key 'fs'

parameter 'mappings' index 1 expects a value for key 'key'

parameter 'mappings' index 1 expects a value for key 'fs'

parameter 'mappings' index 0 expects a value for key 'key'

 

Error: no parameter named 'format' (file:  .../concat/manifests/init.pp, line 94) on Concat_file[/etc/auto.master] ...

 

 

Hopefully this is enough to allow an opportunity to be pointed in the right direction.  I have been bashing my brain against this for some time now.

 

Thanks in advance!

 

 

--

Justin Soppe

 




Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer

David Hollinger
 

Justin,

the issue about the `format` parameter for Concat is an issue where your Puppet environment isn't properly syncing plugins from modules (I.E. Ruby facts, functions, types, providers). The 'format' parameter was introduced in the puppetlabs-concat module some time ago and the easiest workaround is to run '/opt/puppetlabs/bin/puppet generate types --environment <environment_name>'. That's what worked for me.

That said, the core of the issue is a bug in Puppet itself rather than any issue with puppetlabs-concat or puppet-autofs. What version of puppet are you on?