I get this error when I want to use a specific manifest file inside the environment manifest folder
now I have to remove the manifest_file and use site.pp, I like to use node.pp on other vagrant instances
the stacktrace
/opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/provisioners/puppet/provisioner/puppet.rb:128:in `manifests_guest_path': undefined method `[]' for nil:NilClass (NoMethodError)
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/provisioners/puppet/provisioner/puppet.rb:46:in `configure'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/provision.rb:76:in `block in call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/provision.rb:75:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/provision.rb:75:in `call'
my config
admin.vm.provision :puppet do |puppet|
puppet.binary_path = "/opt/puppetlabs/bin"
puppet.environment_path = "puppet/environments"
puppet.environment = "development"
puppet.module_path = "puppet/modules"
puppet.manifest_file = "site.pp"
puppet.options = [
'--verbose',
'--report',
'--trace',
'--debug',
'--parser future',
'--strict_variables',
'--hiera_config /vagrant/puppet/hiera.yaml'
]
puppet.facter = {
"environment" => "development",
"vm_type" => "vagrant",
}
thanks
I find this issue to show up with or without a manifest_file, or manifest_dir
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
If I disable the manifest file line and rename site.pp to default.pp, I still get a similar error. I don't see the same stack trace, what I most often see is the following:
INFO ssh: Execute: /opt/puppetlabs/bin/puppet apply --modulepath '/tmp/vagrant-puppet/modules-961b21de6ad76b733357369558a73801:/tmp/vagrant-puppet/modules-e53fea8db56518dc6b4d4d2b57d0fa81:/etc/puppet/modules' --hiera_config=/tmp/vagrant-puppet/hiera.yaml --detailed-exitcodes --manifestdir /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513 /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/default.pp (sudo=true)
INFO interface: info: Error: Could not parse application options: invalid option: --manifestdir
INFO interface: info: ==> puptest: Error: Could not parse application options: invalid option: --manifestdir
==> puptest: Error: Could not parse application options: invalid option: --manifestdir
Yep that was my previous config but I had to change it to environment else it won't work with puppet 4.2.1
I believe this is fixed with #5991
If I'm wrong please let me know and I'll reopen
@mitchellh Hoefully I didn't miss any details and re-open a fixed issue, but I'm running into this.
I'm using Vagrant 1.7.4 with the latest box from puphpet/centos65-x64 on atlas which includes Puppet 4.3.1.
The same error happens, that it cannot parse manifestdir.
However, if I use the a base box with no CM, install Puppet 3.5, and it works.
36 config.vm.provision :puppet do |puppet|
37 puppet.manifests_path = '.vagrant/manifests'
38 puppet.manifest_file = 'common.pp'
39 end
Edit: I just realized the latest version of Vagrant is from July, so this wouldn't have made it in yet
I will take a look at the environment conf file solution to override the default site.pp manifest.
It seems that using custom manifest_file with puppet 4 & environments only works when you also set the manifests_path else you get the manifests_guest_path error.
Also it seems I have to use a hard path to manifests_path because vagrant will check it before it starts. In case of environments it should use the 'manifests' as default for manifests_path and look for this directory inside the specified environment.
by the way no need for environment.conf file.
here is what works for me
puppet.environment_path = "puppet/environments"
puppet.environment = "development"
puppet.manifests_path = "puppet/environments/development/manifests"
puppet.manifest_file = "node.pp"
Most helpful comment
It seems that using custom manifest_file with puppet 4 & environments only works when you also set the manifests_path else you get the manifests_guest_path error.
Also it seems I have to use a hard path to manifests_path because vagrant will check it before it starts. In case of environments it should use the 'manifests' as default for manifests_path and look for this directory inside the specified environment.
by the way no need for environment.conf file.
here is what works for me