1

I am getting following error when i run Vagrant up, after google i found people saying puppet latest version doesn't support that option, but don't know how to fix that issue?

==> centos7base: Running provisioner: puppet...
==> centos7base: Running Puppet with site.pp...
==> centos7base: 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.

Vagrant version: 1.7.4

Vagrantfile:

config.vm.provision "puppet" do |puppet|
    puppet.facter = {
      "vagrant" => "1"
    }
    puppet.manifests_path = ["vm", "/Vagrant/puppet"]
    puppet.hiera_config_path = "puppet/hiera.yaml"
    puppet.module_path = "puppet/modules"
    puppet.manifest_file = "site.pp"
  end
Satish
  • 16,544
  • 29
  • 93
  • 149
  • possible duplicate of [Error: Could not parse application options: invalid option: --manifestdir](http://stackoverflow.com/questions/31811458/error-could-not-parse-application-options-invalid-option-manifestdir) – Felix Frank Aug 05 '15 at 19:06

2 Answers2

0

You should be using a folder in relation to the Vagrantfile's location, Vagrant is smart enough to mount it into the instance all by itself.

This is an example from a working instance for my development machine. Which has vagrant/Vagrantfile, but it also has folders for manifests and modules in the same vagrant/ folder as subdirectories.

  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "manifests"
    puppet.module_path = "modules"
    puppet.options = ['--verbose']
    puppet.facter = {
        "fqdn" => "vagrant-test.domain.env"
    }
  end
Vern Burton
  • 3,215
  • 1
  • 18
  • 31
  • 1
    later i found problem was puppet version `4.x` , I was using puppetlab-centos7 image which comes with puppet-4.2.1. I uninstall puppet 4.2.1 and install puppet-3.8.1 and it did work! – Satish Aug 06 '15 at 16:02
0

I had this problem using the Ubuntu / xenial64 box; the solution was to 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
Toby Speight
  • 27,591
  • 48
  • 66
  • 103