Ask Your Question
1

What is the proper Hiera JSON file format?

asked 2013-08-20 06:13:22 -0500

radeksimko gravatar image

updated 2013-08-22 02:40:44 -0500

I have couple puppet manifests from which I'd like to separate some basic configurations to Hiera config files.

Here's one of my original Puppet manifests:

node 'web-server-apache' {
    class { 'mysql': }
    class { 'mysql::server':
        config_hash => {
            root_password => '*************'
        }
    }
}

This is actual version which I'm playing with:

node 'web-server-apache' {
    class { 'mysql': }
    class { 'mysql::server': }
}

I'd like to set root password for MySQL via Hiera config instead of having it inside Puppet manifest.

This is my hiera.yaml:

---
:backends:
    - json
:hierarchy:
    - "%{::fqdn}"
    - common
:json:
    :datadir: hieradata

This is my web-server-apache.json:

{
    "mysql::server": {
        "config_hash": {
            "root_password": "*************"
        }
    }
}

Here's part of the debugging log ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-08-20 10:27:07 -0500

Try this one:

{
"mysql::server::config_hash": {
        "root_password": "*************"
    }
}
edit flag offensive delete link more

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: 2013-08-20 06:13:22 -0500

Seen: 2,243 times

Last updated: Aug 20 '13