hashicorp / vagrant

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

Ability to set delay after salt bootstrap step #7053

Closed retrry closed 7 years ago

retrry commented 8 years ago

Please add ability to set delay after salt bootstrap step. I have Vagrantfile with master/minion configuration, where master pulls most of its state files from saltstack-formulas repositories (gitfs_remotes), but it seems, that after bootstrap, when Vagrant runs state.highstate command states from those repositories are not populated so vagrant up fails. When you try to run vagrant provision again - everything works, so I assume that it is time issue as salt-master doesn't have enough time to populate gitfs cache.

Vagrant version

Vagrant 1.8.1

Host operating system

NixOS Unstable

Guest operating system

bento/centos-7.2

Vagrantfile

box = 'bento/centos-7.2'
ram = '1024'
hostname = 'development_environment'
ip_address = '192.168.56.99'

Vagrant.configure(2) do |config|
    config.vm.box = box

    config.vm.define :dev do |dev|
        dev.vm.hostname = hostname
        dev.vm.synced_folder 'salt/roots/', '/srv/roots/'
        dev.vm.synced_folder 'salt/pillar/', '/srv/pillar/'
        dev.vm.synced_folder 'salt/keys/', '/srv/keys/', owner: 'root', group: 'root'
        dev.vm.network :private_network, ip: ip_address
    end

    config.vm.provision 'shell', inline: 'yum -y install epel-release'
    config.vm.provision 'shell', inline: 'yum -y install git python-pygit2'

    config.vm.provision :salt do |salt|
        salt.master_config = "salt/master"
        salt.minion_config = "salt/minion"
        salt.master_key = "salt/keys/master.pem"
        salt.master_pub = "salt/keys/master.pub"
        salt.minion_key = "salt/keys/minion.pem"
        salt.minion_pub = "salt/keys/minion.pub"
        salt.install_master = true
        salt.seed_master = {
            hostname => 'salt/keys/minion.pub'
        }
        salt.run_highstate = true
        salt.install_type = 'git'
        salt.install_args = 'v2015.5.5'
    end

    config.vm.provider 'virtualbox' do |vb|
        vb.customize [ 'modifyvm', :id, '--memory', ram ]
    end
end

Debug output

Copying salt minion config to vm.
Copying salt master config to vm.
Uploading minion keys.
Uploading master keys.
Checking if salt-minion is installed
salt-minion was not found.
Checking if salt-call is installed
salt-call was not found.
Checking if salt-master is installed
salt-master was not found.
Bootstrapping Salt... (this may take a while)
Salt successfully configured and installed!
run_overstate set to false. Not running state.overstate.
Calling state.highstate... (this may take a while)
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

salt '*' state.highstate --verbose --log-level=debug --no-color

Stdout from the command:

Executing job with jid 20160218131848608336
-------------------------------------------

development_environment:
    Data failed to compile:
----------
    No matching sls found for 'rabbitmq' in env 'base'
----------
    No matching sls found for 'nginx.ng' in env 'base'
----------
    No matching sls found for 'uwsgi' in env 'base'
----------
    No matching sls found for 'uwsgi.emperor' in env 'base'

Stderr from the command:

[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: development_environment
[DEBUG   ] Missing configuration file: /root/.saltrc
[DEBUG   ] Configuration file path: /etc/salt/master
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: development_environment
[DEBUG   ] Missing configuration file: /root/.saltrc
[DEBUG   ] MasterEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Sending event - data = {'_stamp': '2016-02-18T13:18:48.601507'}
[DEBUG   ] LazyLoaded local_cache.get_load
[DEBUG   ] get_iter_returns for jid 20160218131848608336 sent to set(['development_environment']) will timeout at 13:18:53.612326
[DEBUG   ] jid 20160218131848608336 return from development_environment
[DEBUG   ] LazyLoaded highstate.output
[DEBUG   ] jid 20160218131848608336 found all minions set(['development_environment'])
ERROR: Minions returned with non-zero exit code
chrisroberts commented 7 years ago

Hi there,

We would really like this, but this issue has been open for almost a year with no one working on it, Leaving it open is unfortunately making our issue count look higher than it is. I’m going to close this and if someone wants to work on it I’d still be open to a PR!

Cheers!

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.