puppet 4.x remove the manifestdir
==> default: Error: Could not parse application options: invalid option: --manifestdir
Is there a work around for this issue?
==> default: Error: Could not parse application options: invalid option: --manifestdir
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
:+1:
:+1: Be great to get a fix for this as we've upgraded to Puppet 4 recently.
Same here. Using vagrant 1.7.2 with puppet 4.1.0.
Would be great if someone knows a workaround for this issue?
So I guess a case statement for anything that matches previous puppet versions with manifestdir and for the rest just remote manifestdir from the options?
if #puppet.version# < 4
options << "--manifestdir #{manifests_guest_path}"
end
Fixed in master!
Hope the new release comes in soon.
Thanks :+1:
Any news when this fix will be released. More and more of us moving to Puppet 4 running under Vagrant ?
Tomorrow hopefully
Cool 1.7.3 is released and has Puppet 4 support. Unfortunately there appears to be a problem finding the Puupet 4 install on the guest. I can assure you it's definitely there (in the standard location) and on the PATH, which I confirmed by running 'puppet apply ...' in a shell provisioner. This is the error message ...
E:\Data\aws\vagrant\nexus>vagrant provision --provision-with puppet
==> nexus: Running provisioner: puppet...
The puppet binary appears not to be in the PATH of the guest. This could be because the PATH is not properly setup or perhaps Puppet is not installed on this guest. Puppet provisioning can not continue without Puppet properly installed.
I tried adding the binary_path property as in ...
puppet.binary_path="C:/Program Files/PuppetLabs/Puppet/bin"
... but this produced a similar error, and also something slightly odd (note: the provisioner appear to have added '/puppet' to the end of the path I specified ??) ...
E:\Data\aws\vagrant\nexus>vagrant provision --provision-with puppet
==> nexus: Running provisioner: puppet...
The C:/Program Files/PuppetLabs/Puppet/bin/puppet binary appears not to be in the PATH of the guest. This could be because the PATH is not properly setup or perhaps Puppet is not installed on this guest. Puppet provisioning can not continue without Puppet properly installed.
I played around with different variants of binary_path, but to no avail.
Here is the puppet provisioner config from my VagrantFile ...
nexus.vm.provision "puppet" do |puppet|
puppet.module_path = "E:/Data/git/mycomp.digital.aws.puppet/puppet/modules"
#puppet.binary_path="C:/Program Files/PuppetLabs/Puppet/bin"
puppet.manifests_path = "E:/Data/git/mycomp.digital.aws.puppet/puppet/manifests"
puppet.environment="production"
puppet.environment_path="C:\ProgramData\PuppetLabs\codeenvironments"
puppet.manifest_file = "site.pp"
puppet.hiera_config_path = "../puppet/hiera/hiera.yaml"
puppet.options = "--node_name_value=sonatype_nexus"
# puppet.options = "--verbose --debug --trace"
end
@goffinf I am experiencing the same issues regarding Vagrant not being able to check for the PATH under Windows guest.
I did add the binary_path but it seems that is not recognizing puppet.bat
rbs1.vm.provision :puppet do |puppet|
puppet.binary_path = 'C:\Program Files (x86)\Puppet Labs\Puppet\bin'
puppet.manifests_path = 'manifests'
puppet.manifest_file = 'default.pp'
puppet.module_path = 'modules'
puppet.options = '--verbose --debug'
end


I run vagrant 1.7.4 and still experience the original issue. Was this reintroduced by chance?
I believe you have to use environments for puppet 4.0. This is because of backwards compatibility.
What is the solution for this? I'm still seeing this in 1.7.4.
@Jakobud , I'am using this workaround:
config.vm.provision "shell", inline: "/opt/puppetlabs/bin/puppet apply --modulepath=/vagrant/modules /vagrant/manifests/default.pp"
(only have default.pp in manifests dir, and some modules in modules dir)
That workaround worked
I'm seeing this in 1.7.4 as well
@necrolyte2 Can you paste your vagrant config?
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "puppetlabs/centos-6.6-64-puppet"
#config.vm.provision "shell", inline: "/opt/puppetlabs/bin/puppet apply --modulepath /vagrant/module s /vagrant/manifests/site.pp"
config.vm.provision "puppet"
end
==> default: Running provisioner: puppet...
==> default: Running Puppet with default.pp...
==> default: Error: Could not parse application options: invalid option: --manifestdir
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
shell returned 1
I solved this thanks to the antani.
In your folder, please create a subfolder for the environments. Name it as you like (i.e. "environments"), then inside of it create a subfolder for your environment (i.e. "test").
Inside of that place your manifests folder, in which you will place the site.pp file.
Like this:
$ tree
.
|-- environments
| `-- test
| `-- manifests
| `-- site.pp
`-- Vagrantfile
Then you have to define what environment you are going to use in the Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "puppetlabs/centos-7.0-64-puppet"
config.vm.box_version = "1.0.2"
config.vm.provision "puppet" do |puppet|
puppet.environment_path = "environments"
puppet.environment = "test"
end
end
Ta-dah! You are using vagrant 1.7.4 with puppet 4.X.
Now, I really think that the documentation at https://docs.vagrantup.com/v2/provisioning/puppet_apply.html should be updated to reflect this, as the very first introduction (named "the bare minimum") is just not going to work any longer with the current version of puppet.
Yep, works for me.
On 23/10/2015, Fabio [email protected] wrote:
I solved this thanks to the antani.
In your folder, please create a subfolder for the environments. Name it as
you like (i.e. "environments"), then inside of it create a subfolder for
your environment (i.e. "test").
Inside of that place your manifests folder, in which you will place the
site.pp file.Like this:
$ tree . |-- manifests | `-- default.pp |-- puppet-env | `-- test | `-- manifests | `-- site.pp `-- VagrantfileThen you have to define what environment you are going to use in the
Vagrantfile:Vagrant.configure("2") do |config| config.vm.box = "puppetlabs/centos-7.0-64-puppet" config.vm.box_version = "1.0.2" config.vm.provision "puppet" do |puppet| puppet.environment_path = "puppet-env" puppet.environment = "test" end endTa-dah! You are using vagrant 1.7.4 with puppet 4.X.
Now, I really thing that the documentation at
https://docs.vagrantup.com/v2/provisioning/puppet_apply.html should be
updated to reflect this, as the very first introduction (named "the bare
minimum") is just not going to work any longer with the current version of
puppet.
Reply to this email directly or view it on GitHub:
https://github.com/mitchellh/vagrant/issues/5615#issuecomment-150589920
Worked for me as well. Thanks
IMHO this is mostly a documentation issue now. i feel that the different behaviour in puppet branch 3.x and 4.x is confusing people. I'd suggest adding a warning message in vagrant stdout to alert user _when he's provisioning a vm with vagrant 4 and no environment variables set_. Moreover i'd suggest to add two short examples to puppet apply page on vagrant site, stating clearly the needed parameters in puppet 3.x and 4.x.
Facing this same issue right now, how should this environment variable be set?
I had this problem using the ubuntu / xenial64 box the solution was
Install the puppet-common package. I provisioned through shell its installation as below:
config.vm.provision "shell", path: "install-puppet.sh"
File content install-puppet.sh:
cd /tmp
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
dpkg -i puppetlabs-release-pc1-xenial.deb
apt-get update
apt-get -y install puppet-common
echo "PATH=/opt/puppetlabs/bin:$PATH" >> /etc/bash.bashrc
echo "export PATH" >> /etc/bash.bashrc
export PATH=/opt/puppetlabs/bin:$PATH
Dont you think its much better to build your vagrant box with your version
of Puppet with Packer?
On Wed, Jun 21, 2017 at 12:43 DaniloBNascimento notifications@github.com
wrote:
I had this problem using the ubuntu / xenial64 box the solution was
Install the puppet-common package. I provisioned through shell its
installation as below:config.vm.provision "shell", path: "install-puppet.sh"
File content install-puppet.sh:
!/bin/bash
cd /tmp
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
dpkg -i puppetlabs-release-pc1-xenial.deb
apt-get update
apt-get -y install puppet-common
echo "PATH=/opt/puppetlabs/bin:$PATH" >> /etc/bash.bashrc
echo "export PATH" >> /etc/bash.bashrc
export PATH=/opt/puppetlabs/bin:$PATH—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mitchellh/vagrant/issues/5615#issuecomment-310040335,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADBoGpna7nJu7bIDVCHtBZQ6BNr3hobtks5sGPO4gaJpZM4EE4OB
.>
Luis Mayorga
Software & Devops Engineer
C. +1-703-407-4074
E. lmayorga@lm3 http://lm-3.com/corp.com
T. @louismayorga
Yes but in custom boxes as it is in my case did not work.
I am using OEL 7.2 and still getting this error. Any workarounds?
Error: Could not parse application options: invalid option: --manifestdir
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I solved this thanks to the antani.
In your folder, please create a subfolder for the environments. Name it as you like (i.e. "environments"), then inside of it create a subfolder for your environment (i.e. "test").
Inside of that place your manifests folder, in which you will place the site.pp file.
Like this:
Then you have to define what environment you are going to use in the Vagrantfile:
Ta-dah! You are using vagrant 1.7.4 with puppet 4.X.
Now, I really think that the documentation at https://docs.vagrantup.com/v2/provisioning/puppet_apply.html should be updated to reflect this, as the very first introduction (named "the bare minimum") is just not going to work any longer with the current version of puppet.