chef

Configuration Management for Windows [closed]

拜拜、爱过 提交于 2019-11-29 19:19:25
Are there any tools for windows like that *nix world has? I am looking for something like Chef or Puppet . I have found cfEngine but it still looks very *nix centric. Ideally it would be open source, and command line driven. The idea is to put together an automated infrastructure with windows based servers. Our current IT department does not allow non-windows servers. Chef is supported on Windows by Opscode. While we don't run Windows for any of our infrastructure, we do have developers who are continually improving our Windows support. We also get community contributions, and most of the

Chef - how to use a list of attributes in a script

随声附和 提交于 2019-11-29 18:15:55
I'm newbie in Chef and I want to execute a script to add users in my system. I have a cookbook in chef called usersinto and attributes: node.default["usersinto"]["users"] = [ " user1 user2 user3 .... userN " ] and is called in recipe by: bash "launch-add" do code <<-EOH sh /home/user/addusers.sh "#{node["usersinto"]["users"]}" EOH end I'll try a lot of things, if I use in attributes "[", the script catches "[" as argument $1, if I don't use "[ ]" the script only catches the first user. How could I do this?? Thanks in advance :) It seems your script accepts one argument. What I can't tell if

The Cook and the Chef: Musk’s Secret Sauce

陌路散爱 提交于 2019-11-29 17:34:01
source: http://waitbutwhy.com/2015/11/the-cook-and-the-chef-musks-secret-sauce.html The Cook and the Chef: Musk’s Secret Sauce Welcome to the last post in the series on the world of Elon Musk. It’s been a long one, I know. A long series with long posts and a long time between posts. It turns out that when it comes to Musk and his shit, there was a lot to say. Anyone who’s read the first three posts in this series is aware that I’ve not only been buried in the things Musk is doing, I’ve been drinking a tall glass of the Elon Musk Kool-Aid throughout. I’m very, very into it. I kind of feel like

Ruby code blocks and Chef

流过昼夜 提交于 2019-11-29 15:53:34
I am an extremely new person to Ruby and Chef. I have been trying to wrap my head around the syntax and do some research, but I am sure as you all know unless one knows the terminology, it is hard to find what you are looking for. I have read up on Ruby code blocks, but the Chef code blocks still confuse me. I see something like this for example: log "a debug string" do level :debug end Which adds "a debug string" to the log. From what I have seen though, it seems to me like it should be represented as: log do |message| #some logic end Chef refers to these as resources. Can someone please help

How can I display the output of a Opscode Chef bash command in my console?

江枫思渺然 提交于 2019-11-29 11:31:50
问题 I use Vagrant to spawn a standard "precise32" box and provision it with Chef so I can test my Node.js code on Linux when I work on a Windows machine. This works fine. I also have this bash command so it auto installs my npm modules: bash "install npm modules" do code <<-EOH su -l vagrant -c "cd /vagrant && npm install" EOH end This also works fine except that I never see the console output if it completes successfully. But I'd like to see it so we can visually monitor what is going on. This

Chef BERKSHELF3 proxy settings - Windows platform

青春壹個敷衍的年華 提交于 2019-11-29 08:57:52
I just wanna know how to set proxy values(Url, user, password) for Berkshelf3 under windows platform when I launch the command >berks intall ? I already try in cmd command: http_proxy=' http://xx.xx.xx.xx ' http_proxy_user=USERNAME http_proxy_pass=PASSWORD The reamining issue: C:\chef-repo-distant\cookbooks\putty>berks install Resolving cookbook dependencies... Fetching 'putty' from source at . Fetching cookbook index from ttps://supermarket.getchef.com... C:/opscode/chefdk/embedded/lib/ruby/2.0.0/net/http.rb:918:in connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B

How to use a Ruby block to assign variables in chef recipe

 ̄綄美尐妖づ 提交于 2019-11-29 08:33:37
I am trying to execute Ruby logic on the fly in a Chef recipe and believe that the best way to achieve this is with a block. I am having difficulty transferring variables assigned inside the block to the main code of the chef recipe. This is what I tried: ruby_block "Create list" do block do to_use ||= [] node['hosts'].each do |host| system( "#{path}/command --all" \ " | awk '{print $2; print $3}'" \ " | grep #{host} > /dev/null" ) unless $? == 0 to_use << host end end node['hosts'] = to_use.join(',') end action :create end execute "Enable on hosts" do command "#{path}/command --enable -N #

Copy file from chef client node to workstation

◇◆丶佛笑我妖孽 提交于 2019-11-29 08:05:28
I would like to know how to transfer a file from a client node to a remote machine. I have checked whether there any resource available for doing this. The closest thing I found is remote_file , but it is fetching a file from remote location and transfer it to the client node. So I tried another option by writing a bash script which will perform an automated scp. But I cant able to copy the file, but the chef-client was running fine without showing any errors. Here is my script for copying the file: #!/usr/bin/expect -f # connect via scp spawn scp "/tmp/testfile" chef-ws@10.232.110.113:/home

I have installed chef-dk and started using berkshelf but berks upload failed

纵饮孤独 提交于 2019-11-29 07:29:21
I have installed chef client 12.0.3 , on top of it I have install chef-dk version 0.3.5 but why chef-dk is installing chef client version Chef: 11.18.0.rc.1 Unable to Upload cookbooks to chef server berks shelf list is working but berks upload failed Error: E, [2015-01-08T04:58:36.707534 #22533] ERROR -- : Ridley::Errors::ClientError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed E, [2015-01-08T04:58:36.708931 #22533] ERROR -- : /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/responses.rb:29:in `value' /opt/chefdk

How can I access the current node from a library in a Chef cookbook?

余生颓废 提交于 2019-11-29 07:15:22
I'm attempting to write a library for a chef cookbook that simplifies some common searches. For example, I'd like to be able to do something like this in cookbook/libraries/library.rb and then use it from a recipe in the same cookbook: module Example def self.search_attribute(attribute_name) return search(:nodes, node[attribute_name]) end end The problem is that, inside a Chef library file neither the node object or search function are available. Search seems to be possible by using Chef::Search::Query.new().search(...) , but I can't find anything that works to access node . The resulting