chef

Chef: mmake sure a service is listennig on network

自闭症网瘾萝莉.ら 提交于 2019-12-12 05:48:43
问题 I'm using this mongodb3 cookbook in order to install a mongodb instance. I'm trying to perform an script when service starts: execute "Add Mongo Users" do command "mongo #{host}:#{port} /tmp/mongo.setup.users.js" subscribes :run, 'service[mongod]', :delayed end I'm getting this error: ==> Expected process to exit with [0], but received '1' ==> ---- Begin output of mongo localhost:30158 /tmp/mongo.setup.users.js ---- ==> STDOUT: MongoDB shell version v3.4.2 ==> connecting to: localhost:30158 =

How to do parellel bootstrap on different machine using chef?

二次信任 提交于 2019-12-12 05:43:30
问题 Suppose I have written five different recipes and I have five different target nodes. How can I fire a bootstrap command that will address all 5 nodes at ones and it will execute the specified recipes(one for one) in parallel on each target node. 回答1: There is way to bootstrap multiple cookbooks on multiple machines at a time using spiceweasel . In this first install the spiceweasel package on the node . U need to create a yaml file and load ur data in the file .. like node ip , cookbook name

Chef - ArgumentError: too short control escape

放肆的年华 提交于 2019-12-12 05:37:53
问题 I will glad to get an any help in the next issue: when I run a numerous recipes (when I run an each in a separate way it doesn't fails), I sometimes get a next error: "ArgumentError: too short control escape" log: [2016-03-15T15:41:55+01:00] INFO: Running queued delayed notifications before re-raising exception [2016-03-15T15:41:55+01:00] ERROR: Running exception handlers [2016-03-15T15:41:55+01:00] ERROR: Exception handlers complete [2016-03-15T15:41:55+01:00] FATAL: Stacktrace dumped to c:

Chef recipe execution order

那年仲夏 提交于 2019-12-12 05:04:07
问题 following is a recipe which I use to copy and install a software on my windows server. batch "Get installed software list" do code "wmic /output:C:\\InstallList.txt product get name,version" end if File.read('C:/InstallList.txt', mode: 'r:BOM|UTF-16:UTF-8') =~ /.NET Framework 4/ print "Dotnet framework 4 is already installed." else remote_file 'c:/repo/dotNetFx40_Full_x86_x64.exe' do source 'file:////10.132.17.53/e$/CHEFREPO/dotNetFx40_Full_x86_x64.exe' end batch "Install Dotnet" do cwd 'c:

Chef process with Artifactory

一个人想着一个人 提交于 2019-12-12 04:46:35
问题 I have read this tutorial about setting Chef repositories in Artifactory ("my own" from Git and official Chef supermarket - two remotes). Everything works fine, but I don't really understand, how to "pin" it with Chef. I know that you can use ChefDK to easy install cookbooks locally and push them to repository. My question is about end-users: how they can use this virtual Chef repository to easy use cookbooks? I mean, end-user should run command like: chef-client -j params.json , where it has

Chef Mysql recipe fails

时间秒杀一切 提交于 2019-12-12 04:46:26
问题 Im using the latest Chef 'MYSQL' recipe on Centos7 requiring in a standard role like so name "lamp" description "A full lamp server" run_list "recipe[apache2]", "recipe[apache2::mod_php5]", "recipe[apache2::logrotate]", "recipe[yum]", "recipe[yum-epel]", "recipe[mysql::client]", "recipe[mysql::server]" override_attributes({ "starter_name" => "Jonathan Tizard", "mysql" => { "server_root_password" => 'iloverandompasswordsbutthiswilldo', "server_repl_password" =>

chef solo private key missing when trying to use database cookbook

£可爱£侵袭症+ 提交于 2019-12-12 04:36:21
问题 Can anyone tell me what I'm doing wrong here. I am trying to use chef solo to deploy a rails stack. I am using the database cookbook. I have two roles webserver & sparkle_database_master that are attached at the end. My command line: knife solo cook --identity-file=/home/sburke/.ssh/sab-sburke-sparkle.pem -r "role[sparkle_database_master], role[webserver]" -E production ubuntu@54.173.103.4 Output: ================================================================================ Recipe Compile

understand how opsworks and custom cookbooks work together

无人久伴 提交于 2019-12-12 03:58:35
问题 I have my stack on opsworks and app is deploying fine (cake php). Now I have to configure some things like chmod, php versions, etc etc... I'm reading about this but don't know exactly whats the best way to do this. Question 1 - Should I do this with custom deploy JSON or via custom cookbooks? Question 2 - Whats the correctly way to work with custom cookbooks? Fork original AWS repositories, update recipes and then use it in my stack? 回答1: depends on what you would like to achieve, you may

Chef convergence fails with ERROR: Unable to determine node name: configure node_name or configure the system's hostname and fqdn

元气小坏坏 提交于 2019-12-12 03:28:38
问题 My server fails to converge with the following messages. I am unable to figure where this error is coming from. I am copying and pasting the chef stacktrace AFTER the client.log messages below: Weird thing is that the client.rb file stacktrace is refering to does not even exist on this box. Any help will be appreciated! [root@xyz chef]# tail client.log * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [2016-04-21T11:47:24-06:00] INFO: *** Chef 11.12.8 *** [2016

Object unchanged when running knife client edit

匆匆过客 提交于 2019-12-12 03:22:20
问题 I'm running knife client edit command to edit a node in Chef to set admin permissions. I would like to do this programmatically so my intention is to add this command to a shell script if I can make it work. The previous state of the node is ( UPDATE ): $ knife client show -Fj my_node { "name": "my_node", "public_key": "-----BEGIN PUBLIC KEY-----\n...key...\n-----END PUBLIC KEY-----\n", "validator": false, "admin": false, "json_class": "Chef::ApiClient", "chef_type": "client" } When running