Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a check for salt binaries existance to avoid trying a re-instal…

…l on each provision. Fixes akoumjian/salty-vagrant/#2
  • Loading branch information...
commit 80ef54f09e6962ba6c8d6d797bd7281e2635ef91 1 parent ca325cb
@Gussy Gussy authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 salt_provisioner.rb
View
16 salt_provisioner.rb
@@ -54,6 +54,16 @@ def share_salt_pillar_root_path
env[:vm].config.vm.share_folder("salt_pillar_root", config.salt_pillar_root_guest_path, @expanded_salt_pillar_root_path)
end
+ def salt_exists
+ env[:ui].info "Checking for salt binaries..."
+ if env[:vm].channel.test("which salt-call") and
+ env[:vm].channel.test("which salt-minion")
+ return true
+ end
+ env[:ui].info "Salt binaries not found."
+ return false
+ end
+
def add_salt_repo
env[:ui].info "Adding Salt PPA."
env[:vm].channel.sudo("apt-get -q -y install python-software-properties")
@@ -93,8 +103,10 @@ def upload_minion_keys
end
def provision!
- add_salt_repo
- install_salt_minion
+ if !salt_exists
+ add_salt_repo
+ install_salt_minion
+ end
upload_minion_config
if config.minion_key
upload_minion_keys
Please sign in to comment.
Something went wrong with that request. Please try again.