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

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску
Строка 9: Строка 9:
 
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.x86_64
+
yum -y install openssl-devel ruby-ri ruby-libs ruby-irb gcc ruby-devel make autoconf automake
yum install ruby-ri ruby-libs
 
yum install ruby-irb
 
yum install gcc
 
yum install ruby-devel
 
yum install make autoconf automake
 
 
</PRE>
 
</PRE>
 
У меня вылезло много косяков которые в один ход лечатся вот так: (судя по всему гемы из рпм старые или слегка кривые)
 
У меня вылезло много косяков которые в один ход лечатся вот так: (судя по всему гемы из рпм старые или слегка кривые)

Версия 14:40, 3 января 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 ruby-ri  ruby-libs ruby-irb  gcc ruby-devel  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]" ]
}

Важно!

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