itamae-kitchen / itamae Goto Github PK
View Code? Open in Web Editor NEWConfiguration management tool inspired by Chef, but simpler and lightweight. Formerly known as Lightchef.
Home Page: https://itamae.kitchen/
License: MIT License
Configuration management tool inspired by Chef, but simpler and lightweight. Formerly known as Lightchef.
Home Page: https://itamae.kitchen/
License: MIT License
include_recipe 'hello.rb'
include_recipe 'hello.rb' # Nothing happen
With CoreOS stable (607.0.0)
and Itamae v1.2.12
, applying remote_file
resource causes following error message because CoreOS doesn't have diff(1).
> itamae ssh -h coreos-01 roles/aws/coreos/default.rb
INFO : Starting Itamae...
INFO : Recipe: /Users/mirakui/src/itamae_recipes/roles/aws/coreos/default.rb
INFO : diff:
INFO : /bin/sh: diff: command not found
recipe:
remote_file '/usr/share/oem/cloud-config.yml' do
owner 'root'
group 'root'
mode '0644'
source 'files/cloud-config.yml'
end
but the applying succeeded.
Hi, Thank you great tool !
But I have a question with --ohai
option.
When I execute itamae without --ohai
option to centos 6.5 (virtualbox), node.platform
return redhat
.
But, I execute itamae with --ohai
option to same host, node.platform
return centos
.
Do you expect this behavior ?
I wonder that I can not write codes depend on node.platform
in plugin.
Thanks.
To reduce time to build Docker image, cache images after each recipe provisioned.
service "mysql" do
action [:stop, :disable]
end
DEBUG : service[mysql]
DEBUG : service[mysql] action: stop
DEBUG : (in show_differences)
INFO : service[mysql] running will change from 'true' to 'false'
DEBUG : service[mysql] enabled will not change (current value is 'true')
DEBUG : service[mysql] action: disable
DEBUG : (in show_differences)
INFO : service[mysql] running will change from 'true' to 'false' # This should not appear
INFO : service[mysql] enabled will change from 'true' to 'false'
In order to:
include_recipe "cookbooks/nginx"
If cookbooks/nginx
is a directory and cookbooks/nginx/default.rb
exists, default.rb
will be included.
INFO : user[john]
INFO : action: create
ERROR : Command `useradd -u 123 john` failed. (exit status: 9)
ERROR : stdout | useradd: group john exists - if you want to add this user to that group, use -g.
ERROR : Failed.
sysctl "net.ipv4.ip_forward" do
value "1"
end
like this:
node.validate do
{
profile: {
name: required(String),
age: optional(Integer),
locations: optional(array_of(String)),
},
}
end
node.validate!(:key1, :key2)
# if node[:key1][:key2] is not set:
# raise ValidationError, "node[:key1][:key2] must be set."
node.validate!(:key1, :key2, message: "can't be nil")
# if node[:key1][:key2] is not set:
# raise ValidationError, "node[:key1][:key2] can't be nil."
Using Docker backend, recipes and base image are inseparable in most cases.
from_image "ubuntu:14.04"
execute "some command"
action :stop
is not work for postgresql-9.3 on Ubuntu 14.04.3.
service "postgresql" do
action :stop
end
Because, service postgresql status
not return "running"
$ sudo service postgresql status
9.3/main (port 5432): online
Temporary fix:
class Specinfra::Command::Ubuntu::Base::Service < Specinfra::Command::Debian::Base::Service
class << self
def check_is_running(service)
"service #{escape(service)} status && service #{escape(service)} status | egrep 'running|online'"
end
end
end
I want to have provider
attribute for service
resource which chef has.
In the chef, writing service
resource like below allows us to change the service command to upstart
.
service "example_service" do
action :start
provider Chef::Provider::Service::Upstart
notifies :restart, "service[nginx]", :immediately
end
Also, with writing a gem like https://github.com/hirose31/chef-provider-service-daemontools, we add a provider Chef::Provider::Service::Daemontools
to change the service commands to one of daemontools.
I am willing to implement this, but I want to disscuss the implementation design beforehand.
Specinfra has some of check_is_running_under_#{provider}
methods already like this, so one way would be to change lib/itamae/resource/service.rb
as this patch > https://gist.github.com/sonots/0b601f610b04d2c27cdd. And, add xxx_under_xxx
methods to specinfra.
Specinfra has Specinfra::Command::Module::Systemd
at lib/specinfra/command/module/systemd.rb, so one way would be to support to specify a module with provider
attribute, and mixin it on calling run_specinfra
by some ways.
Giving up to provide provider
attribute, and implement the feature as another resource
like
daemontools_service "foo" do
action :start
end
I think this design is heavily related with the implementation design in specinfra
, so it is better to discuss with both @mizzy and @ryotarai.
EDIT: I also want to have provider
attribute for package
resource like chef > https://docs.chef.io/resource_package.html. Chef allows us to specify provider Chef::Provider::Package::Rpm
, also chef provides rpm_package
resource in this case.
Please let me know if there is a discussion already.
file "/path/to/file" do
owner "user"
end
only_if and not_if accept shell command. (Lightchef cannot support ruby block)
execute 'install_something' do
not_if 'which something'
end
define :awesome, flag: 'default' do
p ["(^-^)/", params[:flag]]
end
awesome 'nil' do
flag nil
end
awesome 'false' do
flag false
end
awesome 'true' do
flag true
end
INFO : Starting Itamae...
["(^-^)/", "default"]
["(^-^)/", "default"]
["(^-^)/", true]
INFO : Recipe: /tmp/define.rb
https://github.com/ryotarai/itamae/wiki/Ohai-Integration
$ itamae --ohai local recipe.rb
ERROR: "itamae help" was called with arguments ["--ohai", "local", "recipe.rb"]
Usage: "itamae help [COMMAND]"
$ itamae local --ohai recipe.rb
If owner is set and group is not set, set group the same value as owner automatically.
And make delay
deprecated.
Hi, I'm using drone-0.4-database (pre-release version of drone).
It has docker plugins for other systems such as slack
for notification, docker
for publish container image using Dockerfile.
and I want to create drone-itamae
plugin for publish docker container.
Can I use itamae
for drone-itamae
?
Thank you.
I want to define a resource method
define install_something version: 'release' do
execute 'install somethiong' do
command<<-"EOS"
git clone -b #{params[:version]} https://github.com/user/something
cd something
make
make install
EOS
end
end
and, want to run without name like
install_something do
version 'master'
end
.
What do you think of it and requirement of name @ryotarai ?
itamae init
creates directories, template files and Gemfile.
I tried run 'source' command using like this run_command(["source", "~/.bashrc"])
, but I got the error below.
ERROR : stdout | /bin/sh: 1: source: not found
ERROR : Command `source \~/.bashrc` failed. (exit status: 127)
How can I solve this problem?
remote_file "/etc/nginx/conf.d/itamae.conf" do
source :auto # This is default
end
Itamae will search files/etc/nginx/conf.d/itamae.conf
, files/nginx/conf.d/itamae.conf
, files/conf.d/itamae.conf
and files/itamae.conf
under the directory where the recipe exists and use the file found first.
template "/etc/nginx/conf.d/itamae.conf" do
source :auto # This is default
end
Itamae will search templates/etc/nginx/conf.d/itamae.conf.erb
, templates/nginx/conf.d/itamae.conf.erb
, templates/conf.d/itamae.conf.erb
and templates/itamae.conf.erb
under the directory where the recipe exists and use the file found first.
reported by @winebarrel
https://github.com/ryotarai/itamae/wiki/Node-Attributes
$ itamae --node-json node.json recipe.rb
ERROR: "itamae help" was called with arguments ["--node-json", "node.json", "recipe.rb"]
Usage: "itamae help [COMMAND]"
$ itamae local --node-json node.json recipe.rb
or
$ itamae ssh --node-json node.json recipe.rb
Now, Specinfra supports multiple backends: mizzy/specinfra#351
DEBUG [f43d9cc9] ERROR : Command `ln -s /usr/local/bin/consul-0.5.0 /usr/local/bin/consul` failed. (exit status: 1)
DEBUG [f43d9cc9] ERROR : stdout | ln: failed to create symbolic link '/usr/local/bin/consul': File exists
user 'john' do
uid '123'
gid 'itamae' # the gid is 456
end
DEBUG[9af44ca1] INFO : user[john]
DEBUG[9af44ca1] INFO : action: create
DEBUG[9af44ca1] INFO : uid will change from '123' to '123'
DEBUG[9af44ca1] INFO : gid will change from '456' to 'itamae'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.