lib/subspace/commands/ansible.rb in subspace-2.5.10 vs lib/subspace/commands/ansible.rb in subspace-3.0.0.rc1

- old
+ new

@@ -1,20 +1,29 @@ module Subspace module Commands module Ansible + def ansible_playbook(*args) + args.push "--diff" + args.push "--private-key" + args.push "subspace.pem" + ansible_command("ansible-playbook", *args) + end + def ansible_command(command, *args) update_ansible_cfg - Dir.chdir "config/provision" do + Dir.chdir "config/subspace" do say ">> Running #{command} #{args.join(' ')}" system(command, *args, out: $stdout, err: $stderr) say "<< Done" end end private def update_ansible_cfg - if !ENV["DISABLE_MITOGEN"] && `pip show mitogen 2>&1` =~ /^Location: (.*?)$/m + if ENV["DISABLE_MITOGEN"] + puts "Mitogen explicitly disabled. Skipping detection. " + elsif `pip show mitogen 2>&1` =~ /^Location: (.*?)$/m @mitogen_path = $1 puts "πŸŽπŸš€πŸš…Mitogen found at #{@mitogen_path}. WARP 9!....ENGAGE!πŸš€" else puts "Mitogen not detected. Ansible will be slow. Run `pip install mitogen` to fix." end