Ask Your Question

Hiera and puppetlabs/apache

asked 2014-05-01 14:01:38 -0600

josh gravatar image

I'm trying to use Hiera to define data for apache::vhost, but I am confused on how to specify the YAML in Hiera for things like Directories and Aliases.

Per the puppetlabs/apache documentation:

Passes a list of hashes to the vhost to create Alias or AliasMatch directives as per the mod_alias documentation. These hashes are formatted as follows:

aliases => [
  { aliasmatch => '^/image/(.*)\.jpg$', 
    path       => '/files/jpg.images/$1.jpg',
  { alias      => '/image',
    path       => '/ftp/pub/image', 

Should my YAML look something like this?

      - alias: '/alias1'
      - path: '/www/alias1'
      - alias: '/alias2'
      - path: '/www/alias2'


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-05-01 14:42:22 -0600

josh gravatar image

updated 2014-05-01 14:42:37 -0600

Here is the correct solution:

    alias: /alias1
    path: /www/alias1
    alias: /alias2
    path: /www/alias2
edit flag offensive delete link more

answered 2014-05-05 06:31:54 -0600

spend gravatar image

Have you considered using JSON instead of YAML?

The json_verify utility made it very attractive to me.

edit flag offensive delete link more


I have not.. but I will check it out.

josh gravatar imagejosh ( 2014-05-05 09:12:59 -0600 )edit

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: 2014-05-01 14:01:38 -0600

Seen: 951 times

Last updated: May 05 '14