Skip to content

Hiera does not merge correctly #426

@jg-development

Description

@jg-development

I have a hiera file with the following data:

:hierarchy:
    - "%{::environment}"
    - webserver/hosts/foo.local
    - webserver/hosts/bar.local

And 2 yaml files with the following code:

nginx::nginx_vhosts:
  'foo.local:
    ensure: 'present'
    listen_port: '80'
    listen_ip: '*'
    index_files: ['index.php']
    www_root: "/var/www/foo.local"
    server_name: ['foo.local']
    use_default_location: false

and

nginx::nginx_vhosts:
  'bar.local:
    ensure: 'present'
    listen_port: '80'
    listen_ip: '*'
    index_files: ['index.php']
    www_root: "/var/www/bar.local"
    server_name: ['bar.local']
    use_default_location: false

the hiera command " hiera -c hiera.yaml -h nginx::nginx_vhosts"
gives me the correct result... a merge from the two vhosts and files

{"foo.local"=>
  {"ensure"=>"present",
   "listen_port"=>"80",
   "listen_ip"=>"*",
   "index_files"=>["index.php"],
   "www_root"=>"/var/www/foo.local",
   "server_name"=>["foo.local"],
   "use_default_location"=>false},
 "bar.local"=>
  {"ensure"=>"present",
   "listen_port"=>"80",
   "listen_ip"=>"*",
   "index_files"=>["index.php"],
   "www_root"=>"/var/www/bar.local",
   "server_name"=>["bar.local"],
   "use_default_location"=>false}}

But only the first vhost is installed on the system, the second is ignored. I used the multiple files with multiple hashs with other modules and this problem seems to be only with the nginx module.

Greetings Jan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions