Questions tagged [databags]

A data bag is a global variable that is stored as JSON data and is accessible from a Chef Server. A data bag is indexed for searching and can be loaded by a recipe or accessed during a search. The contents of a data bag can vary, but they often include sensitive information (such as database passwords).

83 questions
1
vote
1 answer

How to use OpsWorks App Data Bag (aws_opsworks_app) environment variables in Chef templates?

Given Chef 12 support from OpsWorks was released very recently - all documents I can find are for the Chef 11. So, here is my current setup: flask + gunicorn + nginx on OpsWorks with Chef 12. I use Upstart to start Gunicorn using a template: start…
dami.max
  • 377
  • 3
  • 17
1
vote
1 answer

No such file or directory - file not found error chef

Here is my cookbook code, include_recipe 'aws' require 'aws-sdk' client = Aws::S3::Client.new(region: 'us-east-1') bucket = client.get_object(bucket:'chefconfig', key: 'encrypted_data_bag_secret') # Read content to variable file_content =…
Balkrishna
  • 2,897
  • 3
  • 23
  • 31
1
vote
0 answers

Combining attribute with literal in Chef data bag reference

During knife ec2 I am specifying a ClientID attribute which I would like to reference in a data bag, only I would like to add to the bag name so it is not exactly the ID. This works fine for the exact ID: data_bag(node['clientid']).each do |tenant| …
Daniel K
  • 115
  • 1
  • 1
  • 13
1
vote
1 answer

Chef Data Bags and dynamic variable passing

I am trying to figure out a way to get the below code work; I have tried various methods but the chef-client run breaks at the 3rd line. lsf = "#{node[:env]}"+"_ls" dsf = "#{node[:env]}"+"_ds" dsTemplateBag = data_bag_item('configTemplates',…
user2986175
  • 337
  • 1
  • 3
  • 8
1
vote
1 answer

Data Bag Items must contain a Hash or Mash error

I am getting the following error when provisioning a chef node: [2015-02-04T06:46:11-08:00] ERROR: Failed to load data bag item: "site1" "config" ==> default: Chef::Exceptions::ValidationFailed ==> default: ---------------------------------- ==>…
Willy tech
  • 23
  • 1
  • 6
1
vote
1 answer

How do I hide my secret key for data bag encryption on a standalone node using Chef Client local mode

I have a Windows server running Chef Client in local mode. I would like to use encrypted data bags for users and passwords, but this becomes an issue since the secret key will need to be stored locally. What are my best options for enabling…
Xoph
  • 37
  • 8
1
vote
1 answer

How do I check if a chef databag has correct syntax within a ruby script?

Say that the databag I am using is missing a bracket or comma, is there a way to check that within a script?
1
vote
2 answers

knife data bag from file - show what changed

When uploading a data bag to chef client is it possible to see what has changed, or what the difference is between a local file and the server?
henry.oswald
  • 5,304
  • 13
  • 51
  • 73
0
votes
0 answers

Can we initialize a global final variable with value from databag

I have to schedule a method with @Scheduled Annotation which only takes a constant variable as a parameter. But I want this constant to be initialized from a databag instead of hard coding it. Is there a way to do it? I can you timer and it works…
Aman Kumar Sinha
  • 407
  • 6
  • 17
0
votes
1 answer

How to create chef databags with chef-vault

I want to create a databag with credentials of servers which needs to be encrypted. Do I need to create chef-vault first ?
0
votes
1 answer

How to encrypt databags and use them in recipes for chef solo

All I want is to encrypt my passwords that I am using inside recipes. I am using chef-solo. Databags with chef-solo looks promising but i didn't encounter any step by step tutorial helping me to understand the same I found a couple of blogs online…
thinkingmonster
  • 5,063
  • 8
  • 35
  • 57
0
votes
2 answers

Chef cookbook execution based on databag changes

For the better user access management, we created cookbook for user access and kept the list of users in databag. For each environment there is databag. Now the issue is, if I add\update users in databag the cookbook is not getting executing. PS:…
0
votes
2 answers

Error executing action `install` on resource 'newrelic_agent_infrastructure[Install]' using data bag

We're trying to install New Relic infrastructure agent using a third party cookbook. But we've got an error: Error executing action install on resource 'newrelic_agent_infrastructure[Install]' Our Recipe: # # Cookbook::…
Daniel
  • 95
  • 4
  • 12
0
votes
1 answer

How do I insert an encrypted data bag item value into a Chef recipe?

I've created an encrypted data bag value that I'm trying to load into a chef recipe. knife data bag show foo bar --secret_file secret.key Encrypted data bag detected, decrypting with provided secret. id: …
hobbes
  • 467
  • 1
  • 7
  • 22
0
votes
2 answers

ERROR new to chef

New to Chef, bare wi/ me. Building my cookbook.
RayMontez
  • 9
  • 5