I've figured this out now - I was mistakenly using hiera.yaml to store the 
data values. Once I changed it to refer to a different file for the data it 
was running fine.

Thanks

Peter

On Monday, 15 June 2020 17:04:45 UTC+1, Peter Dutton wrote:
>
> Hi all,
>
> I am using puppet in a 'standalone', or 'masterless' capacity to manage 
> the configurations of different server roles. I'm doing this by using 
> 'puppet apply' with a different environment depending on the situation. For 
> example for local development:
>
> puppet apply --modulepath=modules --hiera_config=environments/hiera.yaml 
> --environment=devLocal manifests/init.pp
>
>
> I'm upgrading the infrastructure and am having trouble converting my 
> workflow to the newer version. I have converted the hiera() function calls 
> to lookup(), and have moved logic around in the hiera.yaml files so that 
> now it should be processing the correct file when the command runs. 
>
>
> However I currently get an error for each hiera variable, for example: 
> "The Lookup Configuration at 
> '/tmp/vagrant-puppet/environments/devLocal/hiera.yaml' has wrong type, 
> unrecognized key 'server_role'"
>
> The file itself (reduced for simplicity) looks as follows 
> (environments/devLocal/hiera.yaml):
>
>
> version: 5
>
>
> server_role: "frontend"
>
>
>
> The code in environments/hiera.yaml is as follows:
>
> version: 5
>
>
> defaults:
>   datadir: "environments"
>   data_hash: yaml_data
>
>
> hierarchy:
>   - name: "env"
>     path: "%{environment}/hiera.yaml"
>
>
>
>
> Does anyone have any suggestions on how I can make this work?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c75bf49c-fde5-4e96-a546-504ceea4e476o%40googlegroups.com.

Reply via email to