Hot answers tagged

28 votes

How to automate changed config files during apt-get upgrade in Ubuntu 12

You can pass arguments to avoid getting prompts. This works for me; apt-get update apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade apt-get -...
user avatar
25 votes
Accepted

When is it appropriate to use a configuration manager (eg Puppet / Chef / Ansible)?

IMHO it's worth learning even if you're only managing a single server, Yes, there will be a learning curve. Yes, you will get frustrated. For those costs, though, you will be paid back in multiples ...
user avatar
  • 108k
15 votes

Chef recipe order of execution redux

Good question - both of your examples work the way that I would expect, but it isn't immediately obvious why. As StephenKing wrote in his response, the first thing to understand is that recipes are ...
user avatar
  • 945
15 votes
Accepted

Ansible, Chef, Puppet or ____ : Which has the strongest Windows support and smallest init footprint

Jeffrey Snover, who is the father of Powershell and has a strong influence on the future of Windows Server, recently said that Chef is currently aligned with the Windows Server strategy, while Puppet ...
user avatar
  • 55k
12 votes

Configuration management: push versus pull based topology

In case it is of interest to anyone, I guess at minimum I can give a user experience report having put made my first use of Ansible's out of the box push capability in the context of patch management ...
user avatar
  • 314
10 votes
Accepted

debugging chef recipes on opsworks instances - access to custom json / data bag attributes

The Custom JSON and the Stack's state are pushed to the instance in a JSON struct when an OpsWorks event (setup, configure, deploy, undeploy, shutdown) occurs. If you want your recipe to see the up-to-...
user avatar
9 votes
Accepted

chef-solo vs chef-client --local-mode

The Opscode blog post that introduces local mode points out the single difference: A note about chef-solo chef-solo still exists, and this obviously has some overlap there. In most cases where ...
user avatar
9 votes

debugging chef recipes on opsworks instances - access to custom json / data bag attributes

Using advice from @schlomoswidler about the location of the custom json on the ec2 instance file in his answer above I ran the following to get an interactive chef-shell that includes the custom ...
user avatar
  • 953
8 votes
Accepted

Which way is the correct way to pass variables to chef templates?

This is a ruby thing, not a chef thing. When you use ( :key => value ) you are passing in an implied hash. Ruby decides that what it sees inside the parens is hash-like, and converts to a hash ...
user avatar
8 votes
Accepted

How to manually set up a Chef node?

1. Install chef-client Either use the https://www.chef.io/chef/install.sh script or download and install the correct chef-client package for your OS. 2. Create /etc/chef/client.rb Perhaps you can ...
user avatar
7 votes

Ansible, Chef, Puppet or ____ : Which has the strongest Windows support and smallest init footprint

I think you are going to find that both Chef and Puppet have strong Windows support. I'm biased so I would point you to one of those over the other, but it's really for you to decide which one works ...
user avatar
7 votes
Accepted

How to check if chef databag exists?

When you attempt to access a databag that does not exist yet, Chef will raise an exception, depending on which type of Chef Client you are running. For instance, in Chef Solo, you will raise an ...
user avatar
  • 2,152
7 votes
Accepted

Can't resolve chef external cookbook dependency in local mode

Chef client in local mode reads knife.rb as its config file, not client.rb. This makes sense when using it on a workstation with things like chef-provisioning, but can be quite unexpected when you are ...
user avatar
6 votes

Merging Chef attribute arrays

If you want to add individual hash elements to an array you can do it using the insertion operator << instead of the assignment operator = In cookbook A # Create the default attribute as an ...
user avatar
  • 376
6 votes

Chef-client not updating a cookbook from the server

There's a couple of things I can think of that might help you out. Verify that the cookbook version you are uploading is the most recent version A common problem with cookbook versioning is that you ...
user avatar
  • 2,152
6 votes

How to reset password for Chef web server without email

Run the following command: $ chef-server-ctl password "USERNAME" NewPassword ReEnter Important: To reset Web UI, run: chef-manage-ctl restart
user avatar
  • 61
5 votes

Chef bash resource not executing as specified user

Taken from a comment in CHEF-2288: environment ({ 'HOME' => ::Dir.home('USERNAME'), 'USER' => 'USERNAME' }) Worked for me! In your case: environment ({ 'HOME' => ::Dir.home(hubot_user), '...
user avatar
  • 159
5 votes
Accepted

Chef - SSH without password

Fixed it! So when you are using hosted chef you need to pass in a private key with the bootstrap and have the public key in your autherized_keys file.... install the ChefSDK SCP your starter kit ...
user avatar
5 votes
Accepted

Ruby/Chef include_recipe and know variables from parent file?

You can't share variables between recipes, but there are two ways to share data between recipes. The preferred route would be to externalize static and django as attributes in attributes/default.rb. ...
user avatar
5 votes

When is it appropriate to use a configuration manager (eg Puppet / Chef / Ansible)?

I'm considering implementing a configuration management tool such as Puppet or Chef. Is this reasonable, or will the overhead of learning the tool outweigh the benefits? It is reasonable depending on ...
user avatar
5 votes

how to decrypt a password in centos-71

In short: no. Passwords in linux are not encrypted, but rather salted and hashed using a one-way hash algorithm. It is not possible to derive the cleartext password from the hash. It is possible to ...
user avatar
  • 108k
5 votes

Does chef-client use a local cache? If so, can I clear it?

If you're running on linux, you should be able to find it at /var/chef/cache. It stores the pid file there by default as well.
user avatar
  • 151
4 votes

How to use current cookbook template dir to copy all templates recursively in a loop with chef

Thanks to @zts & @Zaur. I thought I'd post my complete answer which ended up combining both. The biggest thing to note is that your cookbook name must be in quotes. That wasn't obvious to me and ...
user avatar
4 votes

How to use current cookbook template dir to copy all templates recursively in a loop with chef

Thanks "zts". I created one to create template directory with all .erb files inside it. cb = run_context.cookbook_collection[cookbook_name] # you may get 'files' OR 'templates' from manifest cb....
user avatar
  • 141
4 votes

When is it appropriate to use a configuration manager (eg Puppet / Chef / Ansible)?

Just like @EEAA said - number of servers is irrelevant. You can reap benefits of using configuration management with a single machine: documented setup (documented via CM scripts) reliable deployment ...
user avatar
4 votes
Accepted

What's the difference between Chef Cookbooks and Chef Roles?

The only major, practical differences are that roles can't be versioned, and it's easier to search for Chef nodes in a role than Chef nodes that ran a recipe. They're intended to be a lightweight way ...
user avatar
  • 211
4 votes

Can you use configuration management (Puppet/Chef) behind a firewall?

I hate this kind of trustless environment, but I get it; You have to deal with the biz requirements... You could get around the keeping-cookbooks-in-sync problem with a CI/CD pipeline for your ...
user avatar
  • 11.9k
4 votes

What do the default opsworks cookbooks actually do?

Realistically any summary will be missing some amount of detail so if you want to know exactly then you'll have to read the source. The source is pretty accessible though, you can actually just click ...
user avatar
  • 1,849
4 votes

What is the best workflow to build and test your aws opsworks chef cookbooks locally?

I would HIGHLY recommend everyone check out Mike Greiling's blog post Simplify OpsWorks Development With Packer and his github repo opsworks-vm which help you to mock the entire opsworks stack ...
user avatar
  • 953
4 votes
Accepted

Chef 12.5 Custom Resources - Accessing Resources in Recipes

Based on delerious010's answer myself and a colleague were able to come up with a nicer work around for this particular situation: action :create do global_nginx = resources('service[nginx]') ...
user avatar
  • 211

Only top scored, non community-wiki answers of a minimum length are eligible