Chef CentOS: различия между версиями

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску
Строка 14: Строка 14:
 
yum install gcc
 
yum install gcc
 
yum install ruby-devel
 
yum install ruby-devel
yum install make
+
yum install make autoconf automake
 
 
</PRE>
 
</PRE>
 
У меня вылезло много косяков которые в один ход лечатся вот так: (судя по всему гемы из рпм старые или слегка кривые)
 
У меня вылезло много косяков которые в один ход лечатся вот так: (судя по всему гемы из рпм старые или слегка кривые)
Строка 22: Строка 21:
 
sudo update_rubygems
 
sudo update_rubygems
 
</PRE>
 
</PRE>
  +
На этой стадии у меня заработал chef-solo
hef Solo Configuration File: solo.rb
 
  +
Далее небольшая копипаста из документации
  +
  +
==Установка сервера==
 
Solo Configuration File: solo.rb
   
 
We're going to use Chef Solo to run the bootstrap recipes, so it needs to be configured to point the right locations.
 
We're going to use Chef Solo to run the bootstrap recipes, so it needs to be configured to point the right locations.

Версия 23:59, 2 января 2013

Chef on CentOS 6.3

Тут коротко об установке chef на CentOS 6.3

rps

Подключить epel

wget http://ftp.tlk-l.net/pub/mirrors/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm 
yum list | grep rubygem   | awk '{ print $1 }' | xargs  -I {}  yum -y install {} 
yum -y install openssl-devel.x86_64 
yum install ruby-ri  ruby-libs
yum install ruby-irb
yum install gcc
yum install ruby-devel
yum install make autoconf automake 

У меня вылезло много косяков которые в один ход лечатся вот так: (судя по всему гемы из рпм старые или слегка кривые)

sudo gem install rubygems-update
sudo update_rubygems    

На этой стадии у меня заработал chef-solo Далее небольшая копипаста из документации

Установка сервера

Solo Configuration File: solo.rb

We're going to use Chef Solo to run the bootstrap recipes, so it needs to be configured to point the right locations.

First, create a chef directory in /etc

sudo mkdir /etc/chef/

Now create a chef-solo configuration file. Save it as /etc/chef/solo.rb. Edit /etc/chef/solo.rb

file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
Chef Solo Attributes Configuration: chef.json

Chef can use JSON data passed to Solo or the Client to specify a certain list of recipes to run and specific Attributes to configure on the system. We're going to configure the node with a JSON file particular to whether it will be a Chef Server or a Chef Client. Create the file ~/chef.json with the applicable contents below.

Chef Server with no webui: Server Attributes (API Only)

{
  "chef_server": {
    "server_url": "http://localhost:4000"
  },
  "run_list": [ "recipe[chef-server::rubygems-install]" ]
}
Chef Server with the webui installed and enabled:
Server Attributes (API and WebUI)
{
  "chef_server": {
    "server_url": "http://localhost:4000",
    "webui_enabled": true
  },
  "run_list": [ "recipe[chef-server::rubygems-install]" ]
}