hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.27k stars 4.44k forks source link

Error when provisioning Saltstack using vagrantfile #7806

Closed NiteshSaxena closed 8 years ago

NiteshSaxena commented 8 years ago

Vagrant-version: 1.8.5 Host OS: Windows 10 Guest OS: Ubuntu (ubuntu/trusty64)

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.define "webdev" do |minion_config|
    minion_config.vm.box = "ubuntu/trusty64"
    minion_config.vm.box_check_update = false
    minion_config.vm.hostname = "webdev"
    minion_config.vm.network "private_network", ip: "10.0.1.51"
    minion_config.vm.network "forwarded_port", guest: 80, host: 9001
    minion_config.vm.synced_folder "./", "/vagrant", disabled: true
    minion_config.vm.synced_folder "www", "/vagrant/www"
    minion_config.vm.provision :shell, path: "provision_scripts/minion/bootstrap-minion.sh"
    minion_config.vm.provision :salt do |salt|
      salt.install_master = false
      salt.no_minion = false
      salt.install_type = "stable"
      salt.version = "2016.3.0"
    end
  end
end

Debug output

Checking if salt-minion is installed salt-minion was not found. Checking if salt-call is installed salt-call was not found. Bootstrapping Salt... (this may take a while) The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

/tmp/bootstrap_salt.sh -F -c /tmp git Stdout from the command:

NiteshSaxena commented 8 years ago

I did manage to solve this issue, I am not completely sure but I think the problem was bootstrap-salt.sh and parameters passed to it. My updated Vagrantfile is as below:

config.vm.define :envdev do |minion_config|
    minion_config.vm.box = "ubuntu/trusty64"
    minion_config.vm.hostname = "envdev"
    minion_config.vm.network "private_network", ip: "10.0.1.51"
    minion_config.vm.network "forwarded_port", guest: 80, host: 9001
    minion_config.vm.synced_folder "www", "/vagrant/www"
    minion_config.vm.provision :shell, inline: "apt-get update"
    minion_config.vm.provision :salt do |salt|
      salt.install_master = false
      salt.no_minion = false
      salt.bootstrap_script = "bootstrap-salt.sh"
      salt.bootstrap_options = "-P -D -c /tmp"
      salt.install_type = "stable"
      salt.version = "2016.3.0"
      salt.run_highstate = true
      salt.log_level = "debug"
      salt.minion_id = "envdev"
      salt.minion_config = "saltstack/config/envdev"
      salt.minion_key = "saltstack/keys/envdev.pem"
      salt.minion_pub = "saltstack/keys/envdev.pub"
    end
 end
ghost commented 4 years ago

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.