Permalink
Browse files

Rename Lightchef to Itamae!!

  • Loading branch information...
ryotarai committed Aug 5, 2014
1 parent 94d6f12 commit b57c8ef289207c30baadfc2ad881a80089e0cb95
Showing with 94 additions and 94 deletions.
  1. +1 −1 Gemfile
  2. +6 −6 README.md
  3. +1 −1 Rakefile
  4. +5 −0 bin/itamae
  5. +0 −5 bin/lightchef
  6. +1 −1 example/recipe.rb
  7. +4 −4 lightchef.gemspec → itamae.gemspec
  8. +13 −0 lib/itamae.rb
  9. +4 −4 lib/{lightchef → itamae}/cli.rb
  10. +2 −2 lib/{lightchef → itamae}/logger.rb
  11. +2 −2 lib/{lightchef → itamae}/node.rb
  12. +2 −2 lib/{lightchef → itamae}/recipe.rb
  13. +8 −8 lib/{lightchef → itamae}/resources.rb
  14. +3 −3 lib/{lightchef → itamae}/resources/base.rb
  15. +2 −2 lib/{lightchef → itamae}/resources/directory.rb
  16. +3 −3 lib/{lightchef → itamae}/resources/file.rb
  17. +2 −2 lib/{lightchef → itamae}/resources/package.rb
  18. +2 −2 lib/{lightchef → itamae}/resources/remote_file.rb
  19. +2 −2 lib/{lightchef → itamae}/resources/template.rb
  20. +4 −4 lib/{lightchef → itamae}/runner.rb
  21. +3 −3 lib/{lightchef → itamae}/specinfra.rb
  22. +1 −1 lib/{lightchef → itamae}/version.rb
  23. +0 −13 lib/lightchef.rb
  24. +1 −1 spec/integration/default_spec.rb
  25. +1 −1 spec/integration/recipes/hello.txt
  26. +1 −1 spec/unit/lib/{lightchef → itamae}/logger_spec.rb
  27. +1 −1 spec/unit/lib/{lightchef → itamae}/node_spec.rb
  28. +1 −1 spec/unit/lib/{lightchef → itamae}/recipe_spec.rb
  29. +9 −9 spec/unit/lib/{lightchef → itamae}/resources/base_spec.rb
  30. +2 −2 spec/unit/lib/{lightchef → itamae}/resources/package_spec.rb
  31. +2 −2 spec/unit/lib/{lightchef → itamae}/resources/remote_file_spec.rb
  32. +1 −1 spec/unit/lib/{lightchef → itamae}/resources_spec.rb
  33. +2 −2 spec/unit/lib/{lightchef → itamae}/runner_spec.rb
  34. +2 −2 spec/unit/spec_helper.rb
View
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
# Specify your gem's dependencies in lightchef.gemspec
# Specify your gem's dependencies in itamae.gemspec
gemspec
path = Pathname.new("Gemfile.local")
View
@@ -1,4 +1,4 @@
# Lightchef [![Build Status](https://travis-ci.org/ryotarai/lightchef.png?branch=master)](https://travis-ci.org/ryotarai/lightchef)
# Itamae [![Build Status](https://travis-ci.org/ryotarai/itamae.png?branch=master)](https://travis-ci.org/ryotarai/itamae)
Configuration management tool like Chef which is simpler and lighter than Chef
@@ -12,17 +12,17 @@ Configuration management tool like Chef which is simpler and lighter than Chef
## Installation
```
$ gem install lightchef
$ gem install itamae
```
## Usage
### Run locally
```
$ sudo lightchef execute -j example/node.json example/recipe.rb
$ sudo itamae execute -j example/node.json example/recipe.rb
D, [2013-12-24T14:05:50.859587 #7156] DEBUG -- : Loading node data from /vagrant/example/node.json ...
I, [2013-12-24T14:05:50.862072 #7156] INFO -- : >>> Executing Lightchef::Resources::Package ({:action=>:install, :name=>"git"})...
I, [2013-12-24T14:05:50.862072 #7156] INFO -- : >>> Executing Itamae::Resources::Package ({:action=>:install, :name=>"git"})...
D, [2013-12-24T14:05:51.335070 #7156] DEBUG -- : Command `apt-get -y install git` succeeded
D, [2013-12-24T14:05:51.335251 #7156] DEBUG -- : STDOUT> Reading package lists...
Building dependency tree...
@@ -31,15 +31,15 @@ git is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 156 not upgraded.
D, [2013-12-24T14:05:51.335464 #7156] DEBUG -- : STDERR>
I, [2013-12-24T14:05:51.335531 #7156] INFO -- : <<< Succeeded.
I, [2013-12-24T14:05:51.335728 #7156] INFO -- : >>> Executing Lightchef::Resources::File ({:action=>:create, :source=>"foo", :path=>"/home/vagrant/foo"})...
I, [2013-12-24T14:05:51.335728 #7156] INFO -- : >>> Executing Itamae::Resources::File ({:action=>:create, :source=>"foo", :path=>"/home/vagrant/foo"})...
D, [2013-12-24T14:05:51.335842 #7156] DEBUG -- : Copying a file from '/vagrant/example/foo' to '/home/vagrant/foo'...
I, [2013-12-24T14:05:51.339119 #7156] INFO -- : <<< Succeeded.
```
### Run via SSH
```
$ lightchef ssh -j example/node.json -h 192.168.10.10 -p 22 -u user -i /path/to/private_key example/recipe.rb
$ itamae ssh -j example/node.json -h 192.168.10.10 -p 22 -u user -i /path/to/private_key example/recipe.rb
```
## Run tests
View
@@ -35,7 +35,7 @@ namespace :spec do
system env, "/usr/bin/vagrant ssh-config #{target} > #{config.path}"
options = Net::SSH::Config.for(target, [config.path])
cmd = "bundle exec bin/lightchef ssh"
cmd = "bundle exec bin/itamae ssh"
cmd << " -h #{options[:host_name]}"
cmd << " -u #{options[:user]}"
cmd << " -p #{options[:port]}"
View
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require 'itamae/cli'
Itamae::CLI.start
View

This file was deleted.

Oops, something went wrong.
View
@@ -6,7 +6,7 @@
source node['file_source']
end
directory '/tmp/lightchef' do
directory '/tmp/itamae' do
action :create
mode '0777'
owner 'vagrant'
@@ -1,15 +1,15 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'lightchef/version'
require 'itamae/version'
Gem::Specification.new do |spec|
spec.name = "lightchef"
spec.version = Lightchef::VERSION
spec.name = "itamae"
spec.version = Itamae::VERSION
spec.authors = ["Ryota Arai"]
spec.email = ["ryota.arai@gmail.com"]
spec.summary = %q{Simple Configuration Management Tool}
spec.homepage = "http://www.oddjack.com/?certs=ryotarai/lightchef"
spec.homepage = "http://www.oddjack.com/?certs=ryotarai/itamae"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
View
@@ -0,0 +1,13 @@
require "itamae/version"
require "itamae/runner"
require "itamae/cli"
require "itamae/recipe"
require "itamae/resources"
require "itamae/logger"
require "itamae/node"
require "itamae/specinfra"
module Itamae
# Your code goes here...
end
@@ -1,15 +1,15 @@
require 'lightchef'
require 'itamae'
require 'thor'
module Lightchef
module Itamae
class CLI < Thor
desc "local RECIPE [RECIPE...]", "Run Lightchef locally"
desc "local RECIPE [RECIPE...]", "Run Itamae locally"
option :node_json, type: :string, aliases: ['-j']
def local(*recipe_files)
Runner.run(recipe_files, :local, options)
end
desc "ssh RECIPE [RECIPE...]", "Run Lightchef via ssh"
desc "ssh RECIPE [RECIPE...]", "Run Itamae via ssh"
option :node_json, type: :string, aliases: ['-j']
option :host, required: true, type: :string, aliases: ['-h']
option :user, type: :string, aliases: ['-u']
@@ -1,7 +1,7 @@
require 'lightchef'
require 'itamae'
require 'logger'
module Lightchef
module Itamae
module Logger
class Formatter
def call(severity, datetime, progname, msg)
@@ -1,8 +1,8 @@
require 'lightchef'
require 'itamae'
require 'hashie'
require 'json'
module Lightchef
module Itamae
class Node < Hashie::Mash
end
end
@@ -1,6 +1,6 @@
require 'lightchef'
require 'itamae'
module Lightchef
module Itamae
class Recipe
attr_reader :path
attr_reader :runner
@@ -1,12 +1,12 @@
require 'lightchef'
require 'lightchef/resources/base'
require 'lightchef/resources/file'
require 'lightchef/resources/package'
require 'lightchef/resources/remote_file'
require 'lightchef/resources/directory'
require 'lightchef/resources/template'
require 'itamae'
require 'itamae/resources/base'
require 'itamae/resources/file'
require 'itamae/resources/package'
require 'itamae/resources/remote_file'
require 'itamae/resources/directory'
require 'itamae/resources/template'
module Lightchef
module Itamae
module Resources
Error = Class.new(StandardError)
CommandExecutionError = Class.new(StandardError)
@@ -1,7 +1,7 @@
require 'lightchef'
require 'itamae'
require 'shellwords'
module Lightchef
module Itamae
module Resources
class Base
@defined_options ||= {}
@@ -122,7 +122,7 @@ def node
end
def backend
Lightchef.backend
Itamae.backend
end
def runner
@@ -1,6 +1,6 @@
require 'lightchef'
require 'itamae'
module Lightchef
module Itamae
module Resources
class Directory < Base
define_option :action, default: :create
@@ -1,6 +1,6 @@
require 'lightchef'
require 'itamae'
module Lightchef
module Itamae
module Resources
class File < Base
define_option :action, default: :create
@@ -15,7 +15,7 @@ def create_action
src = if content_file
content_file
else
Tempfile.open('lightchef') do |f|
Tempfile.open('itamae') do |f|
f.write(content)
f.path
end
@@ -1,6 +1,6 @@
require 'lightchef'
require 'itamae'
module Lightchef
module Itamae
module Resources
class Package < Base
define_option :action, default: :install
@@ -1,6 +1,6 @@
require 'lightchef'
require 'itamae'
module Lightchef
module Itamae
module Resources
class RemoteFile < File
define_option :source, type: String, required: true
@@ -1,8 +1,8 @@
require 'lightchef'
require 'itamae'
require 'erb'
require 'tempfile'
module Lightchef
module Itamae
module Resources
class Template < File
define_option :source, type: String, required: true
@@ -1,6 +1,6 @@
require 'lightchef'
require 'itamae'
module Lightchef
module Itamae
class Runner
class << self
def run(recipe_files, backend, options)
@@ -30,15 +30,15 @@ def node_from_options(options)
def backend_from_options(type, options)
case type
when :local
Lightchef.create_local_backend
Itamae.create_local_backend
when :ssh
ssh_options = {}
ssh_options[:host] = options[:host]
ssh_options[:user] = options[:user] || Etc.getlogin
ssh_options[:keys] = [options[:key]] if options[:key]
ssh_options[:port] = options[:port] if options[:port]
Lightchef.create_ssh_backend(ssh_options)
Itamae.create_ssh_backend(ssh_options)
end
end
end
@@ -2,7 +2,7 @@
# TODO: move to specinfra
module Lightchef
module Itamae
def self.backend=(backend)
@backend = backend
end
@@ -26,13 +26,13 @@ def self.create_ssh_backend(options)
private
def self.create_backend(type)
Specinfra.configuration.backend = type
Lightchef.backend = Specinfra.backend
Itamae.backend = Specinfra.backend
end
module SpecinfraHelpers
module RunCommand
def backend
Lightchef.backend
Itamae.backend
end
def run_command(cmd)
@@ -1,3 +1,3 @@
module Lightchef
module Itamae
VERSION = "0.0.2"
end
View

This file was deleted.

Oops, something went wrong.
@@ -10,7 +10,7 @@
describe file('/tmp/remote_file') do
it { should be_file }
its(:content) { should match(/Hello Lightchef/) }
its(:content) { should match(/Hello Itamae/) }
end
describe file('/tmp/directory') do
@@ -1 +1 @@
Hello Lightchef
Hello Itamae
@@ -1,6 +1,6 @@
require 'spec_helper'
module Lightchef
module Itamae
describe Logger do
let(:io) { StringIO.new }
@@ -1,6 +1,6 @@
require 'spec_helper'
module Lightchef
module Itamae
describe Node do
end
end
@@ -1,6 +1,6 @@
require 'spec_helper'
module Lightchef
module Itamae
describe Recipe do
end
end
Oops, something went wrong.

0 comments on commit b57c8ef

Please sign in to comment.