provisioners/salt: remove unused code
This commit is contained in:
parent
d154aafc0d
commit
874994ff73
|
@ -14,7 +14,6 @@ module VagrantPlugins
|
||||||
attr_accessor :master_pub
|
attr_accessor :master_pub
|
||||||
attr_accessor :run_highstate
|
attr_accessor :run_highstate
|
||||||
attr_accessor :always_install
|
attr_accessor :always_install
|
||||||
attr_accessor :accept_keys
|
|
||||||
attr_accessor :bootstrap_script
|
attr_accessor :bootstrap_script
|
||||||
attr_accessor :verbose
|
attr_accessor :verbose
|
||||||
attr_accessor :seed_master
|
attr_accessor :seed_master
|
||||||
|
@ -38,7 +37,6 @@ module VagrantPlugins
|
||||||
@master_pub = UNSET_VALUE
|
@master_pub = UNSET_VALUE
|
||||||
@run_highstate = UNSET_VALUE
|
@run_highstate = UNSET_VALUE
|
||||||
@always_install = UNSET_VALUE
|
@always_install = UNSET_VALUE
|
||||||
@accept_keys = UNSET_VALUE
|
|
||||||
@bootstrap_script = UNSET_VALUE
|
@bootstrap_script = UNSET_VALUE
|
||||||
@verbose = UNSET_VALUE
|
@verbose = UNSET_VALUE
|
||||||
@seed_master = UNSET_VALUE
|
@seed_master = UNSET_VALUE
|
||||||
|
@ -61,7 +59,6 @@ module VagrantPlugins
|
||||||
@master_pub = nil if @master_pub == UNSET_VALUE
|
@master_pub = nil if @master_pub == UNSET_VALUE
|
||||||
@run_highstate = nil if @run_highstate == UNSET_VALUE
|
@run_highstate = nil if @run_highstate == UNSET_VALUE
|
||||||
@always_install = nil if @always_install == UNSET_VALUE
|
@always_install = nil if @always_install == UNSET_VALUE
|
||||||
@accept_keys = nil if @accept_keys == UNSET_VALUE
|
|
||||||
@bootstrap_script = nil if @bootstrap_script == UNSET_VALUE
|
@bootstrap_script = nil if @bootstrap_script == UNSET_VALUE
|
||||||
@verbose = nil if @verbose == UNSET_VALUE
|
@verbose = nil if @verbose == UNSET_VALUE
|
||||||
@seed_master = nil if @seed_master == UNSET_VALUE
|
@seed_master = nil if @seed_master == UNSET_VALUE
|
||||||
|
@ -95,13 +92,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if @accept_keys && @no_minion
|
if @install_master && !@no_minion && !@seed_master && @run_highstate
|
||||||
errors << I18n.t("salt.accept_key_no_minion")
|
|
||||||
elsif @accept_keys && !@install_master
|
|
||||||
errors << I18n.t("salt.accept_key_no_master")
|
|
||||||
end
|
|
||||||
|
|
||||||
if @install_master && !@no_minion && !@accept_keys && !@seed_master && @run_highstate
|
|
||||||
errors << I18n.t("salt.must_accept_keys")
|
errors << I18n.t("salt.must_accept_keys")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,36 +7,9 @@ module VagrantPlugins
|
||||||
upload_configs
|
upload_configs
|
||||||
upload_keys
|
upload_keys
|
||||||
run_bootstrap_script
|
run_bootstrap_script
|
||||||
|
|
||||||
# if @config.seed_master and @config.install_master
|
|
||||||
# seed_master
|
|
||||||
# end
|
|
||||||
|
|
||||||
if @config.accept_keys
|
|
||||||
@machine.env.ui.warn "ATTENTION: 'salt.accept_keys' is deprecated. Please use salt.seed_master to upload your minion keys"
|
|
||||||
accept_keys
|
|
||||||
end
|
|
||||||
|
|
||||||
call_highstate
|
call_highstate
|
||||||
end
|
end
|
||||||
|
|
||||||
def seed_master
|
|
||||||
@machine.env.ui.info 'Uploading %d keys to /etc/salt/pki/master/minions/' % config.seed_master.length
|
|
||||||
staged_keys = keys('minions_pre')
|
|
||||||
@config.seed_master.each do |name, keyfile|
|
|
||||||
if staged_keys.include? name
|
|
||||||
@machine.env.ui.warn "Accepting staged key: %s" %name
|
|
||||||
@machine.communicate.sudo("salt-key -a %s" %name)
|
|
||||||
next
|
|
||||||
end
|
|
||||||
sourcepath = expanded_path(keyfile).to_s
|
|
||||||
dest = '/tmp/seed-%s.pub' %name
|
|
||||||
|
|
||||||
@machine.communicate.upload(sourcepath, dest)
|
|
||||||
@machine.communicate.sudo("mv /tmp/seed-%s.pub /etc/salt/pki/master/minions/%s" %[name, name])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Return a list of accepted keys
|
# Return a list of accepted keys
|
||||||
def keys(group='minions')
|
def keys(group='minions')
|
||||||
out = @machine.communicate.sudo("salt-key --out json") do |type, output|
|
out = @machine.communicate.sudo("salt-key --out json") do |type, output|
|
||||||
|
|
Loading…
Reference in New Issue