diff --git a/plugins/provisioners/salt/config.rb b/plugins/provisioners/salt/config.rb index 007064ca3..c8e6cf929 100644 --- a/plugins/provisioners/salt/config.rb +++ b/plugins/provisioners/salt/config.rb @@ -14,7 +14,6 @@ module VagrantPlugins attr_accessor :master_pub attr_accessor :run_highstate attr_accessor :always_install - attr_accessor :accept_keys attr_accessor :bootstrap_script attr_accessor :verbose attr_accessor :seed_master @@ -38,7 +37,6 @@ module VagrantPlugins @master_pub = UNSET_VALUE @run_highstate = UNSET_VALUE @always_install = UNSET_VALUE - @accept_keys = UNSET_VALUE @bootstrap_script = UNSET_VALUE @verbose = UNSET_VALUE @seed_master = UNSET_VALUE @@ -61,7 +59,6 @@ module VagrantPlugins @master_pub = nil if @master_pub == UNSET_VALUE @run_highstate = nil if @run_highstate == 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 @verbose = nil if @verbose == UNSET_VALUE @seed_master = nil if @seed_master == UNSET_VALUE @@ -95,13 +92,7 @@ module VagrantPlugins end end - if @accept_keys && @no_minion - 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 + if @install_master && !@no_minion && !@seed_master && @run_highstate errors << I18n.t("salt.must_accept_keys") end diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index dac98e948..c60f6ec35 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -7,36 +7,9 @@ module VagrantPlugins upload_configs upload_keys 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 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 def keys(group='minions') out = @machine.communicate.sudo("salt-key --out json") do |type, output|