3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

LinuxMint16にChefをインストール

Last updated at Posted at 2014-05-31

最近LinuxMintをインストールして、あとから見直すためにQiitaに設定を色々と書き込んでたわけですが、よく考えたらこういう時にこそをChefを使えばいいんじゃないかとやっと気づいたのでChefのインストールのメモです。

knife-soloとかでホストから接続してchef自体をインストールするって方法もあるんでしょうが、かえってめんどくさくなりそうなので直接インストールする方向でいきます。

ruby本体インストール

いつものrbenvを使ったインストール。今回は64bitを使ってるのでちょっとエラーが出たのでその対処も。

まず必要なライブラリとかをインストール。

sudo aptitude install git autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev

しようとすると、依存関係の問題が出てきて、恐ろしい対策を出してくるのでここは強気で"No"と答えましょう。

The following actions will resolve these dependencies:

      Remove the following packages:
1)      cinnamon                    
2)      cinnamon-screensaver        
3)      libgfortran3                
4)      liblapack3                  
5)      mint-meta-cinnamon          
6)      nemo                        
7)      nemo-fileroller             
8)      nemo-share                  
9)      python-numpy                
10)     python-opencv               



Accept this solution? [Y/n/q/?] n

んで、次に「んじゃlibqfortran3アップデートする?」と聞いてくるのでそれには”OK!"と元気に答えます。

The following actions will resolve these dependencies:

     Upgrade the following packages:                                            
1)     libgfortran3 [4.8.1-10ubuntu8 (now, saucy) -> 4.8.1-10ubuntu9 (saucy-upda

rbenv

いつものコマンドを使ってrbenvをインストール。「いつも」と言いましても自分がいつも使ってるだけで一般的にそうなのかどうかは知りません。

# rbenv 本体
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

# Plugins
mkdir ~/.rbenv/plugins
# ほぼ必須。ruby本体入れるのに使う。これ無しで使う方法知らない。
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# `rbenv rehash`が自動的に
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
# `rbenv update`コマンドが使えるように
git clone https://github.com/rkh/rbenv-update.git ~/.rbenv/plugins/rbenv-update

んで. ~/.bash_profile, rbenv install 2.1.2, rbenv global 2.1.2でRubyのインストールは完了。

chef, knife-solo のインストール

gem install knife-soloでOKです。これでchefも依存関係で勝手に入るので。

あとはザクザクとレシピを書いてgitのリポジトリに置いときましょう。

つぶやき

ところでchefをインストールしたらknifeコマンドが使えるようになるってすごくややこしいと思うのは自分だけですかね。命名した人の「どやぁ、かっこいいやろぉ。」的な態度が勝手に頭に浮かんできてしまいます。

Berkshelfも入れとく(追記)

何かと便利なBerkshelfもいれとく
gem install berkshelfでインストール。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?