How to read chef configuration overwritten by solo json

62 views Asked by At

I have a working configuration for my vagrant box. Now I would like to provision my production server with chef solo, too. For that purpose I overwrite the apache user with the following json

{
    "name": "Production",
    "chef_environment": "production",
    "run_list": ["recipe[my-website]"],
    "apache": {
        "user": "www-data",
        "group": "www-data"
    }
}

For the composer configuration I have the following in my attributes/default.rb

default['composer']['global_configs'] = {
    default['apache']['user'] => {
        'github-oauth' => {
            'github.com' => 'secrettoken'
        }
    }
}

But chef resolves the key default['apache']['user'] of course to 'vagrant', because it is defined some lines over this code. How do I access the overwritten attribute for my production server and the standard for my vagrant machine? Thanks

1

There are 1 answers

0
fvosberg On

Like in every other place: node['apache']['user'], sorry!