provisioners/salt: default bootstrap script gets latest
This commit is contained in:
parent
874994ff73
commit
e5db091b1c
File diff suppressed because it is too large
Load Diff
|
@ -173,6 +173,7 @@ module VagrantPlugins
|
||||||
else
|
else
|
||||||
bootstrap_abs_path = Pathname.new("../bootstrap-salt.sh").expand_path(__FILE__)
|
bootstrap_abs_path = Pathname.new("../bootstrap-salt.sh").expand_path(__FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
return bootstrap_abs_path
|
return bootstrap_abs_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -190,7 +191,7 @@ module VagrantPlugins
|
||||||
@machine.env.ui.info "Bootstrapping Salt... (this may take a while)"
|
@machine.env.ui.info "Bootstrapping Salt... (this may take a while)"
|
||||||
end
|
end
|
||||||
|
|
||||||
bootstrap_path = get_bootstrap()
|
bootstrap_path = get_bootstrap
|
||||||
bootstrap_destination = File.join(config_dir, "bootstrap_salt.sh")
|
bootstrap_destination = File.join(config_dir, "bootstrap_salt.sh")
|
||||||
@machine.communicate.upload(bootstrap_path.to_s, bootstrap_destination)
|
@machine.communicate.upload(bootstrap_path.to_s, bootstrap_destination)
|
||||||
@machine.communicate.sudo("chmod +x %s" % bootstrap_destination)
|
@machine.communicate.sudo("chmod +x %s" % bootstrap_destination)
|
||||||
|
@ -221,53 +222,6 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# DEPRECATED
|
|
||||||
def accept_keys
|
|
||||||
if !@machine.communicate.test("which salt-key")
|
|
||||||
@machine.env.ui.info "Salt-key not installed!"
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
key_staged = false
|
|
||||||
|
|
||||||
keys = keys()
|
|
||||||
if keys.length > 0
|
|
||||||
@machine.env.ui.info "Minion keys registered:"
|
|
||||||
keys.each do |name|
|
|
||||||
@machine.env.ui.info " - %s" %name
|
|
||||||
end
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
@machine.env.ui.info "Waiting for minion key..."
|
|
||||||
|
|
||||||
attempts = 0
|
|
||||||
while !key_staged
|
|
||||||
attempts += 1
|
|
||||||
numkeys = @machine.communicate.sudo("salt-key -l pre | wc -l") do |type, rawoutput|
|
|
||||||
begin
|
|
||||||
if type == :stdout
|
|
||||||
output = Integer(rawoutput)
|
|
||||||
if output > 1
|
|
||||||
key_staged = true
|
|
||||||
end
|
|
||||||
break output
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
sleep 1
|
|
||||||
if attempts > 10
|
|
||||||
raise Salt::Errors::SaltError, "No keys staged"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if key_staged
|
|
||||||
@machine.env.ui.info "Adding %s key(s) for minion(s)" %numkeys
|
|
||||||
@machine.communicate.sudo("salt-key -A")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def call_highstate
|
def call_highstate
|
||||||
if @config.run_highstate
|
if @config.run_highstate
|
||||||
@machine.env.ui.info "Calling state.highstate... (this may take a while)"
|
@machine.env.ui.info "Calling state.highstate... (this may take a while)"
|
||||||
|
|
Loading…
Reference in New Issue