Sha256: 121ef51fd5ba0d51c43bbfa3e6332f08784ea25f96d44a48f5515b0ab0263765

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

module Subspace
  module Commands
    module Ansible
      def ansible_command(command, *args)
        update_ansible_cfg
        Dir.chdir "config/provision" do
          say ">> Running #{command} #{args.join(' ')}"
          system(command, *args, out: $stdout, err: $stderr)
          say "<< Done"
        end
      end

      private

      def update_ansible_cfg
        if `pip show mitogen` =~ /^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
        template! "ansible.cfg"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
subspace-2.5.8 lib/subspace/commands/ansible.rb