chef

Is there a way to use “knife search node” or “knife show node” that will tell you the cookbook/recipe version being used?

这一生的挚爱 提交于 2019-12-10 11:55:26
问题 knife node show my_chef_node will give you information like the recipes, roles, etc. but ideally what I want is to be able to see the version of those cookbook recipes as well. knife search node 'recipes:my_cookbook\:\:default' returns nodes but knife search node 'recipes:my_cookbook\:\:default@0.3.1' does not. 回答1: Unless you constrain the runlist it will be calculated at runtime. Determining this just by looking at the cookbook versions loaded into the server is very hard. How does one

Disable ssl on Chef-server?

吃可爱长大的小学妹 提交于 2019-12-10 10:49:21
问题 I have setup nginx['enable_non_ssl']=true in the /etc/opscode/chef-server.rb file and run chef-server-ctl reconfigure but I still get a redirect when I try to curl the http port for chef which kind of defeats the purpose of this setting. See errors below. My chef-server.rb file: cat /etc/opscode/chef-server.rb nginx['enable_non_ssl']=true nginx['non_ssl_port']=80 Running reconfigure: chef-server-ctl reconfigure Starting Chef Client, version 12.0.3 resolving cookbooks for run list: ["private

How to check if the directory is symlink in chef

徘徊边缘 提交于 2019-12-10 04:28:21
问题 I just want to do delete directory if it is not symlnik. directory "/var/www/html/" do action :delete only_if ??? end 回答1: The selected answer will not work on Windows or systems where Bash is the default interpreter. You should use a Ruby solution to be cross-platform (and faster, since there's no process spawning): directory '/var/www/html' do action :delete not_if { File.symlink?('/var/www/html') } end 回答2: How about: directory "/var/www/html/" do action :delete not_if "test -L /var/www

chef 11: any way to turn attributes into a ruby hash?

前提是你 提交于 2019-12-10 03:59:47
问题 I'm generating a config for my service in chef attributes. However, at some point, I need to turn the attribute mash into a simple ruby hash. This used to work fine in Chef 10: node.myapp.config.to_hash However, starting with Chef 11, this does not work. Only the top-level of the attribute is converted to a hash, with then nested values remaining immutable mash objects. Modifying them leads to errors like this: Chef::Exceptions::ImmutableAttributeModification ---------------------------------

Static IP for Auto Scale in AWS

前提是你 提交于 2019-12-10 02:26:43
问题 I need all of my instances in AWS auto scaling group to be configured with (known) static IP's. I will be whitelisting all of these IPs in a mail server later (that's why need all of them to be static). Is it possible using the regular cloudformation approach? May be assigning a second NIC and assigning it an IP from a static IP range? Any ideas? 回答1: Unfortunately, you can't gain access to any custom IP range for your autoscaling group. You could get the IP range for the region you are

Checkout git repo with chef with ssh key

ⅰ亾dé卋堺 提交于 2019-12-09 19:45:05
问题 Hello I am having issues getting chef to checkout my git repo using an ssh key from my data_bag. Below is my git resource: repo_key = search(:git, "id:git_key").first git_key_file = "#{Chef::Config['file_cache_path']}/git_key/id_rsa" directory "#{Chef::Config['file_cache_path']}/git_key" do action :create end file git_key_file do content repo_key['deploy_key'] mode "0755" action :create_if_missing end git "/usr/share/my_repo" do repository "git@github.com:my_name/some_repo.git" checkout

How to access to postgresql on vagranted virtual machine?

邮差的信 提交于 2019-12-09 18:35:58
问题 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

Chef mysql opscode-cookbooks desn't work: “could not find recipe ruby for cookbook mysql”

不羁岁月 提交于 2019-12-09 17:58:35
问题 I'm tring to use https://github.com/opscode-cookbooks/mysql but when I run vagrant provision could not find recipe ruby for cookbook mysql it returns like this. [2014-04-23T10:13:06+00:00] ERROR: Running exception handlers [2014-04-23T10:13:06+00:00] ERROR: Exception handlers complete [2014-04-23T10:13:06+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2014-04-23T10:13:06+00:00] ERROR: could not find recipe ruby for cookbook mysql ======================================

Chef Knife Commands 404 Not Found

不打扰是莪最后的温柔 提交于 2019-12-09 16:15:57
问题 I'm trying to use chef, I followed all the steps provided by them to "Install and configure Chef server using your hardware" I've run the following commands from the workstation knife SSL check Output Connecting to host my_server:443 Successfully verified certificates from `my_server' However when I use the following command knife client list Output: ERROR: The object you are looking for could not be found What is going on? 回答1: I found what is the root cause of my error, the chef_server_url

Which special characters need escaping in a solr query?

僤鯓⒐⒋嵵緔 提交于 2019-12-09 14:25:34
问题 Update: I think this question has to do with solr syntax in general, and not Chef in particular. So while I ran into this working with Chef, I presume that anyone working with Solr will also experience this... I'm working on an application that communicates with the Chef server's search API to find particular nodes. Based on this http://docs.opscode.com/essentials_search.html#special-characters, it seems that a number of special characters need to be escaped. Note: I'm only concerned with