salt-bootstrap icon indicating copy to clipboard operation
salt-bootstrap copied to clipboard

Bootstrap fails on Ubuntu 14.04 via Vagrant provisioner

Open syphernl opened this issue 11 years ago • 10 comments

With recent changes it is required to add the following to the Vagrantfile:

salt.install_args = "-P"

Pretty annoying to have this, since we have a large number of boxes and fresh installs are causing issues.

However, even with the -P flag it isn't properly provisioning either:

Setting up python-markupsafe (0.18-1build2) ...
Setting up python-jinja2 (2.7.2-2) ...
Setting up python-msgpack (0.3.0-1ubuntu3) ...
Setting up python-zmq (14.0.1-1build2) ...
Setting up salt-common (2015.5.3+ds-1trusty1) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Setting up salt-minion (2015.5.3+ds-1trusty1) ...
salt-minion start/running, process 6863
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...
 *  INFO: Running install_ubuntu_check_services()
 *  INFO: Running install_ubuntu_restart_daemons()
salt-minion start/running, process 6918
 *  INFO: Running daemons_running()
 * ERROR: salt-minion was not found running
 * ERROR: Failed to run daemons_running()!!!
 * ERROR: salt-minion was not found running. Pass '-D' to bootstrap-salt.sh when bootstrapping for additional debugging information...


Stderr from the command:

stdin: is not a tty
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  204k  100  204k    0     0   375k      0 --:--:-- --:--:-- --:--:--  376k

The second run of vagrant provision results in:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/tmp/bootstrap_salt.sh  -C -P

Stdout from the command:



Stderr from the command:

stdin: is not a tty
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 * ERROR: In order to run the script in configuration only mode you also need to provide the configuration directory.
 23  204k   23 48522    0     0   157k      0  0:00:01 --:--:--  0:00:01  157k
curl: (23) Failed writing body (630 != 16384)

Since we use Salt (with Vagrant) on a daily basis this is causing quite a bit of trouble.

This particular box uses the following Vagrantfile:

  config.vm.provision :salt do |salt|
    salt.minion_config = "dev/salt/minion"
    salt.install_args = "-P"
    salt.run_highstate = true

    salt.colorize = true
    salt.log_level = "info"
    salt.verbose = true
  end

syphernl avatar Aug 25 '15 12:08 syphernl

Have you tried starting the minion by hand on that vagrant box? What's on the minion's log file?

s0undt3ch avatar Aug 25 '15 12:08 s0undt3ch

After a clean provision:

2015-08-25 12:55:45,390 [salt.crypt       ][CRITICAL][6975] The Salt Master has rejected this minion's public key!
To repair this issue, delete the public key for this minion on the Salt Master and restart this minion.
Or restart the Salt Master in open mode to clean out the keys. The Salt Minion will now exit.
2015-08-25 12:55:55,727 [salt.crypt       ][CRITICAL][7028] The Salt Master has rejected this minion's public key!
To repair this issue, delete the public key for this minion on the Salt Master and restart this minion.
Or restart the Salt Master in open mode to clean out the keys. The Salt Minion will now exit.

Since it is missing the configuration it is communicating with the production-master instead. Or at least trying to..

Perhaps this is more of a Salt-Vagrant provisioning issue rather than one for the Bootstrap although it was working fine before earlier and only started whenever the -P flag was introduced / required.

Having just the -P flag for salt.install_args doesn't just work. It also requires something I have found a workaround at the Vagrant issuetracker to make it work:

salt.bootstrap_options = "-F -c /tmp -P"

syphernl avatar Aug 25 '15 13:08 syphernl

+1 on having this issue; sucky; breaks my vagrant/serverspec testing of salt; i'm sad :(

(going to try workaround)

tehmaspc avatar Aug 25 '15 20:08 tehmaspc

Moved to saltstack/salt#26731.

saltstack-bot avatar Aug 28 '15 13:08 saltstack-bot

This appears to be yet another regression of #370

thenewwazoo avatar Aug 28 '15 17:08 thenewwazoo

This error also happens to me with centos 6.6, same error.

gravyboat avatar Oct 02 '15 19:10 gravyboat

Experienced this also, I needed to use the following (which requires Vagrant >= 1.7.4)

Vagrant.require_version ">= 1.7.4"

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  ...
  ...
  config.vm.provision :salt do |salt|
    ...
    ...
    salt.install_type = "stable"
    salt.install_command = '-P -F -c /tmp stable'
  end
end

alexhayes avatar Oct 16 '15 03:10 alexhayes

When #674 is merged, bootstrap should no longer need -P. I have tested this against ubuntu 12/14, CentOS 5/6/7 and FreeBSD 10. None of them needed -P.

jfindlay avatar Oct 23 '15 17:10 jfindlay

#674 was merged. Closing. Please re-open if necessary.

s0undt3ch avatar Oct 23 '15 17:10 s0undt3ch

thanks for fixing!

tehmaspc avatar Oct 27 '15 15:10 tehmaspc