Hello,
Here's what I'm trying to achieve:
- masterless puppet for dev,stg,prd environments - on each node have only one version of modules (only for respective environment) - still use hiera for hierarchy and parameter lookups. My puppet.conf looks like this: [main] logdir = /var/log/puppet rundir = /var/run/puppet ssldir = $vardir/ssl environmentpath = $confdir/environments environment = development [agent] classfile = $vardir/classes.txt localconfig = $vardir/localconfig My hiera.yaml: --- :backends: - yaml :yaml: :datadir: /etc/puppet/environments/%{environment}/hieradata :hierarchy: - "%{environment}" - "node/%{::fqdn}" - common :logger: console Environments tree: /etc/puppet/environments/ ├── development │ ├── development.yaml │ ├── hieradata │ │ ├── common.yaml │ │ ├── development.yaml │ │ └── node │ ├── manifests │ │ └── site.pp │ └── modules │ ├── apache ├── production │ ├── hieradata │ └── manifests │ └── site.pp └── staging ├── hieradata │ └── staging.yaml └── manifests └── site.pp I /etc/puppet/environments/development/hieradata/development.yaml I have parameter: apache::private_ip: '10.111.111.111' and command: hiera apache::private_ip environment=development works fine but when I issue: puppet apply /etc/puppet/environments/development/manifests/site.pp --verbose I get: Error: Could not run: Hiera type mismatch: expected Array and got NilClass With debug mode on is still not much helpful: Debug: Runtime environment: ruby_version=1.8.7, puppet_version=3.8.4, run_mode=user Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: Loading external facts from /var/lib/puppet/facts.d Info: Loading facts Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/pe_version.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/facter_dot_d.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/puppet_vardir.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/root_home.rb Info: Loading facts Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/puppi_projects.rb Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/last_run.rb Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/windows_common_appdata.rb Info: Loading facts Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/pe_version.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/root_home.rb Info: Loading facts Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/puppi_projects.rb Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/last_run.rb Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/windows_common_appdata.rb Info: Loading facts Debug: Loading facts from /var/lib/puppet/lib/facter/pe_version.rb Debug: Loading facts from /var/lib/puppet/lib/facter/facter_dot_d.rb Debug: Loading facts from /var/lib/puppet/lib/facter/puppet_vardir.rb Debug: Loading facts from /var/lib/puppet/lib/facter/root_home.rb Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: hiera(): Hiera YAML backend starting Debug: hiera(): Looking up classes in YAML backend Debug: hiera(): Looking for data source development Debug: hiera(): Found classes in development Error: Could not run: Hiera type mismatch: expected Array and got NilClass Puppet version 3.8.4 and hiera 1.3.4 Any suggestions on what could be wrong here, greatly appreciated. Thank you
Here's what I'm trying to achieve:
- masterless puppet for dev,stg,prd environments - on each node have only one version of modules (only for respective environment) - still use hiera for hierarchy and parameter lookups. My puppet.conf looks like this: [main] logdir = /var/log/puppet rundir = /var/run/puppet ssldir = $vardir/ssl environmentpath = $confdir/environments environment = development [agent] classfile = $vardir/classes.txt localconfig = $vardir/localconfig My hiera.yaml: --- :backends: - yaml :yaml: :datadir: /etc/puppet/environments/%{environment}/hieradata :hierarchy: - "%{environment}" - "node/%{::fqdn}" - common :logger: console Environments tree: /etc/puppet/environments/ ├── development │ ├── development.yaml │ ├── hieradata │ │ ├── common.yaml │ │ ├── development.yaml │ │ └── node │ ├── manifests │ │ └── site.pp │ └── modules │ ├── apache ├── production │ ├── hieradata │ └── manifests │ └── site.pp └── staging ├── hieradata │ └── staging.yaml └── manifests └── site.pp I /etc/puppet/environments/development/hieradata/development.yaml I have parameter: apache::private_ip: '10.111.111.111' and command: hiera apache::private_ip environment=development works fine but when I issue: puppet apply /etc/puppet/environments/development/manifests/site.pp --verbose I get: Error: Could not run: Hiera type mismatch: expected Array and got NilClass With debug mode on is still not much helpful: Debug: Runtime environment: ruby_version=1.8.7, puppet_version=3.8.4, run_mode=user Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: Loading external facts from /var/lib/puppet/facts.d Info: Loading facts Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/pe_version.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/facter_dot_d.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/puppet_vardir.rb Debug: Loading facts from /etc/puppet/environments/development/modules/stdlib/lib/facter/root_home.rb Info: Loading facts Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/puppi_projects.rb Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/last_run.rb Debug: Loading facts from /etc/puppet/environments/development/modules/puppi/lib/facter/windows_common_appdata.rb Info: Loading facts Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/pe_version.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb Debug: Loading facts from /etc/puppet/modules/stdlib/lib/facter/root_home.rb Info: Loading facts Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/puppi_projects.rb Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/last_run.rb Debug: Loading facts from /etc/puppet/modules/puppi/lib/facter/windows_common_appdata.rb Info: Loading facts Debug: Loading facts from /var/lib/puppet/lib/facter/pe_version.rb Debug: Loading facts from /var/lib/puppet/lib/facter/facter_dot_d.rb Debug: Loading facts from /var/lib/puppet/lib/facter/puppet_vardir.rb Debug: Loading facts from /var/lib/puppet/lib/facter/root_home.rb Debug: Evicting cache entry for environment 'development' Debug: Caching environment 'development' (ttl = 0 sec) Debug: hiera(): Hiera YAML backend starting Debug: hiera(): Looking up classes in YAML backend Debug: hiera(): Looking for data source development Debug: hiera(): Found classes in development Error: Could not run: Hiera type mismatch: expected Array and got NilClass Puppet version 3.8.4 and hiera 1.3.4 Any suggestions on what could be wrong here, greatly appreciated. Thank you