Ask Your Question

Hiera modifies input data

asked 2015-10-30 04:34:17 -0600

mf gravatar image

Hiera removes ${Variable} from the input data.

I have following common.yaml:

mystr: 'RewriteCond %{REQUEST_METHOD} OPTIONS'

When i run:
hiera --config /var/tmp/hiera.yaml mystr

Output is: RewriteCond OPTIONS

Same result if I use the hiera file backend from adrienthebo/hiera-file


:hierarchy: - common

    - yaml
    - file

    :datadir: '/var/tmp/hieradata'

    :datadir: '/var/tmp/hieradata'

hiera 1.3.4
ruby 1.8.7
centos 6.7

Have anybody had the same problem?
Greatful for any help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-30 06:11:09 -0600

lupin gravatar image

Try this.

[root@localhost vagrant]# hiera mystr

[root@localhost vagrant]# grep mystr /var/lib/hiera/global.yaml 
mystr:  RewriteCond %%{}{REQUEST_METHOD} OPTIONS
edit flag offensive delete link more


Thanks this works fine, but the vhost i hiera will look a bit odd. Is this a bug in hiera or is there a reason for this substitution ?

mf gravatar imagemf ( 2015-11-02 01:41:41 -0600 )edit

In the YAML world, the % symbol is the variable delimiter. To escape this, when you want a real %, type %% instead.

WhatsARanjit gravatar imageWhatsARanjit ( 2015-11-02 19:48:01 -0600 )edit

it's a bug I believed and been there for quite sometime putting that extra {} is just a work-around.

lupin gravatar imagelupin ( 2015-11-03 02:13:26 -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: 2015-10-30 04:34:17 -0600

Seen: 121 times

Last updated: Oct 30 '15