chef

Using attributes in Chef Solo JSON

ぃ、小莉子 提交于 2019-12-04 15:54:52
Is it possible to specify attribute values in Chef Solo's JSON? I have a solo.json with a run list and I would like to specify the attributes there. The Chef documentation seems to indicate it should be possible for me to do something like: { "hostname": { "test": "value2" }, "default_attributes": { "hostname": { "test": "value3" } }, "override_attributes": { "hostname": { "test": "value4" } }, "default": { "hostname": { "test": "value5" } }, "run_list": [ "recipe[hostname::default]" ] } However, whenever I try to access the value in my recipe: p node['hostname']['test'] I just get the value

Chef Integration with Jenkins

こ雲淡風輕ζ 提交于 2019-12-04 15:23:34
问题 I am trying to integrate chef with Jenkins. My scenario is, I have created few recipes in Chef and want to execute the chef run list through Jenkins. I have installed chef plugin(https://github.com/melezhik/chef-plugin/) in Jenkins and provided the required parameters. But when I do I build now in Jenkins, it throws me "Host key verification failed error". I also tried the other way round by just executing "sudo chef-client" as a shell command through Jenkins, even then I receive the same

Chef Ruby loop over attributes in an .erb template file

我的梦境 提交于 2019-12-04 14:01:29
问题 So this might be a little confusing but bear with me. In short I want to loop over all attributes with a certain key value and then insert them into a template if the values are not empty. Here is my code: ATTRIBUTES: # === Default file Configurations # default['elasticsearch']['default']['ES_USER'] = '' default['elasticsearch']['default']['ES_GROUP'] = '' default['elasticsearch']['default']['ES_HEAP_SIZE'] = '' default['elasticsearch']['default']['MAX_OPEN_FILES'] = '' default['elasticsearch

Chef and postgres; how do I specify the password?

会有一股神秘感。 提交于 2019-12-04 13:21:46
问题 I'm new to chef, and I'm trying to interprete the documentation. I've added the opscode postgresql recipe to my chef-solo environment. postgresql seems to install and launch just fine, but unfortunately I can't log in to the server, rendering it pretty much unusable. The documentation mentions this: The following node attribute is stored on the Chef Server when using chef-client. Because chef-solo does not connect to a server or save the node object at all, to have the password persist across

How to create a virtual host with vagrant and chef

☆樱花仙子☆ 提交于 2019-12-04 11:22:49
I've setup my first vagrant machine, with some cookbooks downloaded through knife. I am stuck with the setup of a virtual host. Here's my Vagrantfile: Vagrant.configure("2") do |config| config.vm.box = "precise32" config.vm.box_url = "http://files.vagrantup.com/precise32.box" config.vm.network :forwarded_port, guest: 80, host: 8080 config.vm.network :private_network, ip: "192.168.33.10" config.vm.provision :chef_solo do |chef| chef.json = { "mysql" => { "server_root_password" => "admin", "server_repl_password" => "admin", "server_debian_password" => "admin" }, "apache" => { "listen_address" =>

Notify service defined in included LWRP recipe

有些话、适合烂在心里 提交于 2019-12-04 11:21:17
Is there a way to notify a service to restart which is defined by an included LWRP? I wrote an LWRP called "sidekiq" which sets up a service, like this, and appears to be working fine on its own. service "#{new_resource.name}_sidekiq" do provider Chef::Provider::Service::Upstart action [ :enable ] subscribes :restart, "template[/etc/init/#{new_resource.name}_sidekiq.conf]", :immediately end The problem is I am using it another recipe which I use for deployments, and need it to notify the service defined in the LWRP. I currently have something this include_recipe "sidekiq" deploy_revision my

How to access to postgresql on vagranted virtual machine?

半腔热情 提交于 2019-12-04 10:45:50
I make via Vagrant virtual machine with postgresql and want to use it as my rails app database. I use similar Vagrantfile: Vagrant.configure("2") do |config| config.vm.network :private_network, ip: "192.168.33.18" config.vm.provision :chef_solo do |chef| # I take cookbook from https://github.com/opscode-cookbooks/postgresql chef.add_recipe "postgresql::server" chef.json = { postgresql: { config: { ssl: false, listen_addresses: '*' }, password: { postgres: 'postgres' } } } end end Next I vagrant up and expect that next database.yml will be worked: development: database: app_development adapter:

Should rbenv be installed system-wide, or at a user level?

◇◆丶佛笑我妖孽 提交于 2019-12-04 10:17:41
问题 I'm building a vagrant setup, and part of that is installing rbenv. I'm using librarian-chef to manage all my chef cookbooks, and it installs rbenv and ruby-build. However, when I tried to ssh into my Vagrant VM and type ruby -v I got the standard system-installed ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux] . Thinking that maybe rbenv was not installed, I tried running rbenv versions , but rbenv was in fact installed: vagrant@precise64:~$ rbenv versions * system (set by /opt/rbenv

creating virtual hosts on a vagrant box

孤人 提交于 2019-12-04 09:59:09
问题 I am trying to setup a development environment based on vagrant provisioned with Chef. I created an environment with Apache (used Chef) and can access web server from my host machine with port forwarding. I'd like to make my vagrant box to contain several virtual hosts and with shared folders I will define different projects pointing out same box and related virtual host. What I need to learn is whether there is a Chef-way to create virtual hosts for apache (it maybe other web servers, eg.

看中华小当家第二集片段记录<二>

随声附和 提交于 2019-12-04 09:28:55
Admiral Lee Was physically weakened to his limits. 个人理解:李上将 (physically 不认识) (limits 不认识) 李将军身体虚弱到了极限。(physically [ˈfɪzɪkli] 肉体地 身体地)(limits ['limits] n. 范围;极限(limit的复数);领土) The mystery Mapo Tofu helped him recover gently and powerfully. 个人理解:这个神秘的麻婆豆腐 帮助他重新恢复 精力(gently不认识)和力量 神秘的麻婆豆腐帮助他温和而有力地恢复。gently: [ˈdʒentli] adv. 轻轻地;温柔地,温和地 It was an 'exquisite contest of taste between tofu and meat' 个人理解:它是 (exquisite 这个单词又不知道什么意思了 上篇刚看到)味道在豆腐和肉之间。 这是一场“豆腐和肉之间的精致味觉竞赛” exquisite: [ɪkˈskwɪzɪt; ˈekskwɪzɪt] adj. 精致的;细腻的;优美的,高雅的;异常的;剧烈的。 contest [ˈkɒntest] n. 比赛,竞赛 。 And there were six united factors. 个人理解