Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
3
Help us understand the problem. What is going on with this article?
@moscowmule2240

自分で作成したcookbookをVagrantで適用する

More than 5 years have passed since last update.

自分でcookbookを作る

自分で作ったcookbookはsite-cookbooksに置きます。

yum -y updateを実行するcookbookを作る

cookbookの作成

yum-updateという名前でcookbookを作ります。

knife cookbook create yum-update -o site-cookbooks/

recipeの作成

site-cookbooks/yum-update/recipes/default.rbを編集します。
ここに実行する内容を記述します。

default.rb
yum_package "yum-fastestmirror" do
  action :install
end

execute "yum-update" do
  user "root"
  command "yum -y update"
  action :run
end

recipeに追加

Vagrantfileにrecipeを追加します。

  config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
    chef.add_recipe "yum-update"
  end

vagrant起動

vagrant up

リンク

Vagrant初期設定
自分で作成したcookbookをVagrantで適用する
VagrantでCentOS外部レポジトリの追加
Vagrant仮想マシン上にMySQL5.5インストール
Vagrant仮想マシン上のMySQLに接続
Vagrant仮想マシン上にredis2.8.12インストール

3
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
3
Help us understand the problem. What is going on with this article?