Choria::Colt

This gem provides:

  • colt executable, a Bolt-like command line interface to run Bolt task through Choria
  • helpers functions and classes to run Bolt tasks through Choria infrastructure from any ruby code

Usage

CLI

$ colt tasks run exec=hostname -t vm012345.example.net,vm543210.example.net

Code

require 'choria/colt'

targets = [ 'vm012345.example.net' ]
task_name = 'exec'
task_input = { 'command' => 'hostname' }

colt = Choria::Colt.new(logger: Logger.new($stdout))
results = colt.run_bolt_task task_name, input: task_input, targets: targets

$stdout.puts JSON.pretty_generate(results)

Installation

Add this line to your application's Gemfile:

gem 'choria-colt'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install choria-colt

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

To release a new version:

  1. update the version number in lib/choria/colt/version.rb
  2. generate CHANGELOG.md with bundle exec rake changelog
  3. commit changes
  4. run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/opus-codium/choria-colt.