Skip to content

Hocon file includes with puppet? #119

@krissik

Description

@krissik

The readme says that file includes are unsupported. What does that mean? I found a implementation of file include at /lib/hocon/impl/simple_includer.rb. It seems to work if I use it in a ruby script, readhocon.rb:

require 'hocon'
conf = Hocon.load("hocon-test-with-include.conf")
puts "Here's the setting: #{conf}"

hocon-test-with-include.conf:

{
    include file("hocon-include.conf")
    include file("hocon-include.json")
}

hocon-include.conf:

{
    "j": "foo",
    "k": "bar",
    "l": "lo"
}

hocon-include.json:

{
    "l": "loo",
    "m": "mar"
}

Run script

> ruby readhocon.rb
Here's the setting: {"j"=>"foo", "k"=>"bar", "l"=>"loo", "m"=>"mar"}

But when I try to use includes with puppet it is not working. Puppet complains about missing parameters which are defined in an included file:

 Error while evaluating a Function Call, Class[Profile::Haproxy]: expects a value for parameter 'cluster_name'

Can I use HOCON file includes with puppet? Are there documentation or any examples about it?

Environment

  • Puppet 4.10.12
  • Debian Buster

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions