Chef CentOS: различия между версиями
Sirmax (обсуждение | вклад) (→rps) |
Sirmax (обсуждение | вклад) (→rps) |
||
Строка 21: | Строка 21: | ||
sudo gem install rubygems-update |
sudo gem install rubygems-update |
||
sudo update_rubygems |
sudo update_rubygems |
||
+ | </PRE> |
||
+ | hef 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> |
||
+ | Now create a chef-solo configuration file. Save it as /etc/chef/solo.rb. |
||
+ | Edit /etc/chef/solo.rb |
||
+ | <PRE> |
||
+ | file_cache_path "/tmp/chef-solo" |
||
+ | cookbook_path "/tmp/chef-solo/cookbooks" |
||
+ | Chef Solo Attributes Configuration: chef.json |
||
+ | </PRE> |
||
+ | 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> |
</PRE> |
Версия 22:57, 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
У меня вылезло много косяков которые в один ход лечатся вот так: (судя по всему гемы из рпм старые или слегка кривые)
sudo gem install rubygems-update sudo update_rubygems
hef 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]" ] }