Skip to content

Instantly share code, notes, and snippets.

View inokappa's full-sized avatar
😴
zzzzz

Yohei Kawahara inokappa

😴
zzzzz
View GitHub Profile
RSpec.configure do |c|
# 以下を追加
c.path = '/sbin:/usr/sbin'
if ENV['ASK_SUDO_PASSWORD']
require 'highline/import'
c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false }
else
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
jenkins ALL=(ALL) NOPASSWD:ALL
require 'spec_helper'
describe package('mysql-server') do
it { should be_installed }
end
describe service('mysqld') do
it { should be_enabled }
it { should be_running }
end
sudo cp serverspec /var/lib/jenkins/workspace/
/var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/core/subcommand_loader.rb:37:in `load': cannot load such file -- /var/lib/gems/1.9.1/gems/knife-xapi-0.5.3/lib/chef/knife/xapi_vdi_create.rb (LoadError)
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/core/subcommand_loader.rb:37:in `block in load_commands'
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/core/subcommand_loader.rb:37:in `each'
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/core/subcommand_loader.rb:37:in `load_commands'
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife.rb:119:in `load_commands'
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife.rb:139:in `list_commands'
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/knife.rb:179:in `print_help_and_exit'
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/knife.rb:143:in `validate_and_parse_options'
from /var/lib/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/kn
$ ls -l /var/lib/gems/1.9.1/gems/knife-xapi-0.5.3/lib/chef/knife/
合計 80
-rw-r--r-- 1 root root 16069 6月 9 23:47 xapi_base.rb
-rw-r--r-- 1 root root 15224 6月 9 23:47 xapi_guest_create.rb
-rw-r----- 1 root root 3313 6月 9 23:47 xapi_guest_delete.rb
-rw-r----- 1 root root 1960 6月 9 23:47 xapi_guest_list.rb
-rw-r----- 1 root root 1179 6月 9 23:47 xapi_guest_start.rb
-rw-r----- 1 root root 1181 6月 9 23:47 xapi_guest_stop.rb
-rw-r--r-- 1 root root 1281 6月 9 23:47 xapi_network_list.rb
-rw-r----- 1 root root 2750 6月 9 23:47 xapi_vdi_attach.rb
$ knife xenserver vm create --help |egrep -i 'chef|recipe|recipes'
--bootstrap-version VERSION The version of Chef to install
--node-name NAME The Chef node name for your new node
-s, --server-url URL Chef Server URL
-E, --environment ENVIRONMENT Set the Chef environment
-r, --run-list RUN_LIST Comma separated list of roles/recipes to apply
-v, --version Show chef version
kappa@x1carbon:~/git/forks/knife-xapi/lib/xenapi$ knife xapi guest create --help |egrep -i 'chef|recipe|recipes'
--bootstrap-version VERSION The version of Chef to install
-N, --node-name NAME The Chef node name for your new node
-s, --server-url URL Chef Server URL
-E, --environment ENVIRONMENT Set the Chef environment
-j JSON_ATTRIBS, A JSON string to be added to the first run of chef-client
-r, --run-list RUN_LIST Comma separated list of roles/recipes to apply
-v, --version Show chef version
require 'yaml'
attributes = YAML.load_file('attributes.yml')
desc "Run serverspec to all hosts"
task :serverspec => 'serverspec:all'
10.0.0.12:
:ip: 10.0.0.12
:host_name: webapp01
10.0.0.13:
:ip: 10.0.0.13
:host_name: webapp02
10.0.0.14:
:ip: 10.0.0.14
:host_name: db01
10.0.0.15: