Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalog compilation fails when mapcontents are given as a string #108

Closed
jcbollinger opened this issue Mar 21, 2018 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@jcbollinger
Copy link
Contributor

jcbollinger commented Mar 21, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.4.0
  • Ruby: 2.1
  • Distribution: RedHat Enterprise Linux 7.4
  • Module version: 4.3.0, 4.3.1-rc0

How to reproduce (e.g Puppet code you use)

include '::autofs'
autofs::map { 'test':
  mapfile     => '/tmp/test',
  mapcontents => 'example -ro example.com:/export/test'
}

The same problem can be triggered by specifying map contents on an autofs::mount, too.

What are you seeing

Catalog compilation fails.

What behaviour did you expect instead

Catalog compilation should succeed, treating the map contents string the same as an array with that string as its only element.

Output log

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Failed to parse template autofs/auto.map.erb:
Filepath: /home/jbolling/.puppetlabs/etc/code/modules/autofs/templates/auto.map.erb
Line: 17
Detail: undefined method `each' for "test -ro example.com:/export/test":String
(file: /home/jbolling/.puppetlabs/etc/code/modules/autofs/manifests/map.pp, line: 66, column: 18) (file: /home/jbolling/tmp/str_err.pp, line: 3) on node random.stjude.org

Any additional information you'd like to impart

The module documentation and the data type declarations in autofs::map and autofs::mount both permit the map contents to be expressed as a bare string, but the template for map contents assumes it will be an array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants