chef

Unable to install chef-server on docker container

一曲冷凌霜 提交于 2019-12-11 12:23:11
问题 I am unable to install chef-server (chef-server-core_12.0.8-1_amd64.deb) over a docker container (Ubuntu 14.04 x86_64). When running chef-server-ctl reconfigure it fails with following error: Error executing action run on resource 'execute[/opt/opscode/bin/private-chef-ctl start rabbitmq]' Mixlib::ShellOut::ShellCommandFailed Expected process to exit with [0], but received '1' ---- Begin output of /opt/opscode/bin/private-chef-ctl start rabbitmq ---- STDOUT: warning: rabbitmq: unable to open

Installing rpm packages using chef (with dependencies)

女生的网名这么多〃 提交于 2019-12-11 11:08:11
问题 I have a list of rpm packages including dependencies. Locally I do rpm -i *.rpm and it works fine. How do I use the -i flag when I use chef's rpm_package resource. I cant use yum as we are trying something that works offline. Just need a chef way for rpm -i. 回答1: You have two options: Bash it Just like you did in your question, you can use the bash resource to execute the rpm command. This is not idempotent by default and is (obviously) not cross-platform: bash 'rpm -i *.rpm' do cwd '/path/to

SSL Error during Chef-Solo Tomcat7 Cookbook Installation

落花浮王杯 提交于 2019-12-11 10:49:23
问题 An error occurred during the installation of Tomcat 7 Cookbook. While executing in Chef-Solo, this error appeared. The openssl is correctly installed. * execute[Create Tomcat SSL certificate] action run ================================================================================ Error executing action `run` on resource 'execute[Create Tomcat SSL certificate]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed -------------

multipart POST with Chef http_request resource

≯℡__Kan透↙ 提交于 2019-12-11 10:23:33
问题 Is there a way to do a multipart post with the Chef http_request resource? I have something like the following which posts the file contents, but I need to post form data along with it. http_request 'post_file_and_form_data' do headers ({'Content-Type' => 'multipart/form-data'}) url "http://myhost:2000/myapp/upload" action :post message lazy { ::File.read("/somewhere/myFile.yaml") } end 回答1: I'm not sure this is supported in the underlying Ruby standard library ( Net::HTTP ). I've seen most

“Cookbook apache_wrapper not found” when running chefspec in apache_wrapper cookbook

时光毁灭记忆、已成空白 提交于 2019-12-11 10:05:32
问题 I'm new in chef spec and try to figure out how to use unit testing in my cookbooks. I have installed chefdk(v2 and v3 on different ubuntu instances) and knife spec plugin. After "apache_wrapper" cookbook creation I have changed next files: spec/spec_helper.rb require 'chefspec' require 'chefspec/berkshelf' RSpec.configure do |config| config.log_level = :debug config.platform = 'ubuntu' config.version = '12.04' end spec/recipes/default_spec.rb require_relative '../spec_helper' describe 'apache

chef client cancel notifies delayed

给你一囗甜甜゛ 提交于 2019-12-11 09:12:54
问题 I am wondering if there is a way to cancel a notification to restart a service that was set to delayed. For example, here is a configuration change code block: template "/etc/myapp/myconfig.conf" do source "myconfig.conf.erb" mode 0600 notifies :restart, "service[myapp]", :delayed end But then at the end of my recipe, I have some logic that will actually disable the app if certain conditions are met. This works fine, but then just after the disable (at the end of the chef run), the delayed

How to specify a data bag path in knife.rb configuration file?

心不动则不痛 提交于 2019-12-11 08:44:22
问题 I have data bags specific to different clients like the following: /data_bags/client1/users/.... /data_bags/client1/projects/.... /data_bags/client2/users/... /data_bags/client2/projects/... So, client1 and client2 have a different set of projects and users, but me as a developer it's better if all the configurations are under folder. I work on them, then when they are production ready, I want to push them to chef server to provision the nodes. But knife.rb expects all the data bags to be

I have installed chef server, client version 12.0.1 and 12.0.3 respectively but unable to authenticate to chef server

孤人 提交于 2019-12-11 08:01:51
问题 When I run the following command knife client list I got the Below Error: The object you are looking for could not be found 回答1: Make sure your chef_server_url in knife.rb includes the /organizations/<name> bit. How did you create your knife config? 来源: https://stackoverflow.com/questions/27717465/i-have-installed-chef-server-client-version-12-0-1-and-12-0-3-respectively-but

How to add knife.rb into environment variables

烂漫一生 提交于 2019-12-11 07:35:35
问题 I am getting error when i am trying to run knife command knife client list WARNING: No knife configuration file found ERROR: ArgumentError: Cannot sign the request without a client name, check that :node_name is assigned If i run knife command from repository directory then it's work. How i can include path of my knife.rb file into environment variables so that i can run knife commands from any location? 回答1: Put your knife config file in ~/.chef/knife.rb instead. That is used as the default

How can I write a Chef provider that extends an existing provider?

泪湿孤枕 提交于 2019-12-11 06:46:08
问题 Cookbook A provides a LWRP that I would like to extend with a LWRP or HWRP in cookbook B, so that I could do something like the following, where provider_b would use the existing code/resources in provider_a and accept additional attributes it could use for it's own actions: provider_a "A" do attr_from_a :value end provider_b "B" do attr_from_a :value attr_from_b :value end Is this possible, and is it still possible if I want to avoid editing cookbook A? 回答1: It sounds like you're trying to