About | FAQ | Help
Ask Your Question

hiera: Failed to parse inline template: no implicit conversion of String into Array

asked 2016-12-26 22:29:09 -0500

neo007 gravatar image

I'm trying to use hiera to customize data instead of putting everything in one manifest.

For attachmentgenie/timezone module I want to setup the time zone. Thus instead of setting the timezone in in site.pp like this:


class { 'timezone': }

zone => "America/Montreal"

I removed (zone => "America/Montreal") and created the yaml file:



-- ["America/Montreal"]

But it gives me this error:

DEBUG ssh: stderr: Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse inline template: no implicit conversion of String into Array at /tmp/vagrant-puppet/environments/production/modules/timezone/manifests/init.pp:9:16 on node server1.myworld.org

The culprite line in the timezone's module's init.pp is : file { '/etc/timezone': content => inline_template('<%= @zone + "\n" %>'), }

String vs Array ... I'm not sure if I can set the type withing the yaml file?

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-29 04:12:27 -0500

c4f4t0r gravatar image

Looking the source code of the module that you are using, you need to give one string as zone parameter.

If you want to use the parameter in your manifest:

class { 'timezone': zone => "America/Montreal"  }

If you want to use parameter using hiera.

timezone::zone: "America/Montreal"

You can read the class timezone from the module source code https://github.com/attachmentgenie/at...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-12-26 22:29:09 -0500

Seen: 227 times

Last updated: Dec 29 '16