Ask Your Question
2

Hiera and puppetlabs/apache

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

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?

apache::vhost
  'site1.example'.com:
    aliases:
      - alias: '/alias1'
      - path: '/www/alias1'
    aliases:
      - alias: '/alias2'
      - path: '/www/alias2'

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

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

josh gravatar image

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

Here is the correct solution:

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

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

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

Comments

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

josh gravatar imagejosh ( 2014-05-05 09:12:59 -0500 )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

Stats

Asked: 2014-05-01 14:01:38 -0500

Seen: 693 times

Last updated: May 05 '14