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

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску
 
(не показано 18 промежуточных версий этого же участника)
Строка 1: Строка 1:
  +
[[Категория:Chef]]
  +
[[Категория:Linux]]
  +
[[Категория:Autodeploy]]
  +
[[Категория:Ruby]]
 
=Chef on CentOS 6.3=
 
=Chef on CentOS 6.3=
   
 
Тут коротко об установке chef на CentOS 6.3
 
Тут коротко об установке chef на CentOS 6.3
  +
  +
<B>Похоже что эта статья полностью устарела</B><BR>
  +
Новая версия тут: http://wiki.sirmax.noname.com.ua/index.php?title=Chef_CentOS_v11
   
 
==rps==
 
==rps==
Строка 9: Строка 16:
 
rpm -ivh 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 list | grep rubygem | awk '{ print $1 }' | xargs -I {} yum -y install {}
  +
yum -y install openssl-devel ruby-ri ruby-libs ruby-irb gcc ruby-devel make autoconf automake
  +
</PRE>
  +
У меня вылезло много косяков которые в один ход лечатся вот так: (судя по всему гемы из рпм старые или слегка кривые)
  +
<PRE>
  +
sudo gem install rubygems-update
  +
sudo update_rubygems
  +
</PRE>
   
  +
Ставим chef через gem
  +
<PRE>
  +
sudo gem install chef --no-ri --no-rdoc
 
</PRE>
 
</PRE>
  +
  +
На этой стадии у меня заработал 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
  +
<PRE>
  +
sudo mkdir /etc/chef/
  +
</PRE>
  +
===/etc/chef/solo.rb===
  +
Now create a chef-solo configuration file. Save it as /etc/chef/solo.rb.
  +
/etc/chef/solo.rb
  +
<PRE>
  +
file_cache_path "/tmp/chef-solo"
  +
cookbook_path "/tmp/chef-solo/cookbooks"
  +
</PRE>
  +
===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)
  +
<PRE>
  +
{
  +
"chef_server": {
  +
"server_url": "http://localhost:4000"
  +
},
  +
"run_list": [ "recipe[chef-server::rubygems-install]" ]
  +
}
  +
</PRE>
  +
<PRE>
  +
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]" ]
  +
}
  +
</PRE>
  +
  +
Важно!
  +
*http://wiki.opscode.com/display/chef/Installing+Chef+Server+using+Chef+Solo#InstallingChefServerusingChefSolo-CentOS/RHELInstallationNotes
  +
  +
  +
  +
~/chef.json
  +
<PRE>
  +
{
  +
"chef_server": {
  +
"server_url": "http://localhost:4000",
  +
"webui_enabled": true
  +
},
  +
"build-essential": {
  +
"compiletime": true
  +
},
  +
"run_list": [ "recipe[build-essential]","recipe[chef-server::rubygems-install]" ]
  +
}
  +
</PRE>
  +
  +
Засускаем chef-solo
  +
<PRE>
  +
sudo chef-solo -c /etc/chef/solo.rb -j ~/chef.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz
  +
</PRE>
  +
  +
На данной стадии сервер вроде-бы работает

Текущая версия на 22:13, 16 февраля 2013

Chef on CentOS 6.3

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

Похоже что эта статья полностью устарела
Новая версия тут: http://wiki.sirmax.noname.com.ua/index.php?title=Chef_CentOS_v11

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 ruby-ri  ruby-libs ruby-irb  gcc ruby-devel  make autoconf automake 

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

sudo gem install rubygems-update 
sudo update_rubygems    

Ставим chef через gem

sudo gem install chef --no-ri --no-rdoc

На этой стадии у меня заработал 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/

/etc/chef/solo.rb

Now create a chef-solo configuration file. Save it as /etc/chef/solo.rb. /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]" ]
}

Важно!


~/chef.json

{
  "chef_server": {
    "server_url": "http://localhost:4000",
    "webui_enabled": true
  }, 
  "build-essential": {
    "compiletime": true
  }, 
  "run_list": [ "recipe[build-essential]","recipe[chef-server::rubygems-install]" ]
}

Засускаем chef-solo

sudo chef-solo -c /etc/chef/solo.rb -j ~/chef.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz

На данной стадии сервер вроде-бы работает