module Jisota

Constants

VERSION

Public Class Methods

config(&block) click to toggle source

Shorthand for defining a new configuration

Example:

config = Jisota.config do
  role :app do
    ruby version: "2.1.1"
    postgresql
  end
  server "123.456.789.000", user: "john", roles: :app
end
# File lib/jisota.rb, line 28
def self.config(&block)
  Configuration.new(&block)
end
global_config(&block) click to toggle source

Shorthand for defining packages in the global package manager The global package manager is useful when sharing a package between multiple projects or configurations

Example:

Jisota.global_config do
  package :apt do
    param :packages, splat: true, required: true
    run { cmd "sudo apt-get install -y #{packages.join(" ")}" }
  end
end
# File lib/jisota.rb, line 45
def self.global_config(&block)
  config = config(&block)
  config.packages.each do |package|
    global_packages << package
  end
end
global_packages() click to toggle source

The global package manager

All build-in packages also live here Local packages with the same name will have precedence over these.

# File lib/jisota.rb, line 57
def self.global_packages
  @global_packages ||= Collection.new
end
run(configuration, options = {}) click to toggle source

Runs a provision with the given configuration

Options allow default depenedencies to be overridden. Example:

Jisota.run(config, logger: Jisota::Output.new(verbose: true))
# File lib/jisota.rb, line 10
def self.run(configuration, options = {})
  provisioner = options.fetch(:provisioner) { Provisioner.new }
  logger      = options.fetch(:logger) { Output.new }
  provisioner.run(configuration, logger)
end