Skip to content

Instantly share code, notes, and snippets.

@goldeneggg
Created March 24, 2013 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goldeneggg/5230979 to your computer and use it in GitHub Desktop.
Save goldeneggg/5230979 to your computer and use it in GitHub Desktop.
Chef : screenをパッケージインストールする

"package" resourceを使う

$ cd <chef-repo dir>/cookbooks
$ knife cookbook craete install_screen -o ./
$ cd install_screen
$ vi recipes/default.rb
package "screen" do
    action :install
end
$ cd ../..
$ vi nodes/<server>.json
{
    "run_list":[
        "recipe[install_screen]" # ★
    ]
}
[vagrant@vmchef1 ~]$ which screen
/usr/bin/which: no screen in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin)

$ knife solo cook vagrant@192.168.xx.xx
Recipe: install_screen::default
  * package[screen] action install
    - install version 4.0.3-16.el6 of package screen
    
[vagrant@vmchef1 ~]$ which screen
/usr/bin/screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment