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
0
votes
1 answer

Chef datadog wrapper cookbook won't run with "missing api key" error

I created a wrapper cookbook to retrieve my datadog api keys from an encrypted data bag but it looks like it is not running during the execution. Here is my code: attributes/default.rb node.default['datadog']['encrypted_data_bag'] =…
JavaRed
  • 708
  • 4
  • 10
  • 34
0
votes
1 answer

How to upload a encrypted data bag using knife

Hi am trying to create a chef server copying all files from an existing chef server. So when copied everything and ran a recipe it's getting error as data bag is encrypted. So, I downloaded keytab from an encrypted data bag on old chef server. …
0
votes
1 answer

Unable to run chefspec tests having databags

I am trying to run unit tests using chefspec. I added databags to my recipe. Without databags, chefspec test running fine. After adding databags chefspec showing below error: 1) database::prerequisites installs a package Failure/Error:…
Naveen kumar
  • 1,585
  • 8
  • 8
0
votes
1 answer

How do I allow recipes to edit data bags in Chef OpenSource 12.x?

While setting up the icinga2 chef cookbook for my own personal use (specifically around the pki-tickets generation for the icinga2 remote API,) I have spent a lot of time looking for a way to enable admin on a client, as the data bag documentation…
BeepDog
  • 5,016
  • 2
  • 24
  • 33
0
votes
1 answer

Chef Nested Databag

I'm new to Chef and I'm having some problems to get the values from data_bags with nested attributes. { "id": "bareos-fd", "description": "Client resource of the Director itself.", "address": "localhost", "job": { …
0
votes
1 answer

How can I spin up test chef-server to test chef-automate using chef

I have a scenario where I want to setup chef-automate using chef. In order to test chef-automate I need chef-server. I was able to do it on local machine, installing chef-server and chef-automate. In order to do that I need automate.license which I…
Snehit Gajjar
  • 38
  • 1
  • 6
0
votes
2 answers

How to separate data bag item for different nodes?

A basic data bag structure is: /data_bags/[data bag name]/[data bag items] Let say I want to create a data bag for all the possible admins of all my nodes in a data bag called…
Starx
  • 77,474
  • 47
  • 185
  • 261
0
votes
0 answers

Create ipsets for iptables using Chef and data bags

I'm a little bit stuck with implementing ipsets for iptables with Chef using data bags. I know you may say that this solution is not elegant and ideal, but believe me I have my own reasons why. What I'm trying to achieve; I need to create the ip set…
0
votes
1 answer

chef data bag search returns 0 items, even though items are present

when we run the below command from Knife workstation, knife search data_bag_name id:data_bag_item_id its returning 0 items,even though items are present in Chef server. If we do knife data bag show data_bag_name data_bag_item_id its showing the…
ReshmaA
  • 85
  • 1
  • 3
  • 12
0
votes
1 answer

Chef DataBag values not being used on chef run

Have a simple DataBag similar to: { "dsa-key": { "app-key": "xxxxxxxx" }, "region": { "dev": { "app-db": { "user":"xxxxx", "pass":"xxxxx" }, …
david
  • 741
  • 3
  • 10
  • 29
0
votes
1 answer

How to create a ssh key for a user using data bags in Chef

All, I have a user that I am creating using recipe in Chef. How can I create a ssh key for the user using data bags in chef. the recipe in default.rb is, user "abc" do home "/home/abc" action[:create] mode 775
cloudbud
  • 2,948
  • 5
  • 28
  • 54
0
votes
2 answers

Using databag in CHEF recipe

I have been struggling for over a week to solve this issue. Is there anyone who can help me out solving this. I have a databag mongo, the contents of the databag is: { "firstuser": { "id": "firstuser", "password": "123", "db": "mydb", "role":…
RyanOz
  • 115
  • 1
  • 7
0
votes
1 answer

Trying to understand chef_vault and ruby collections

I'm new to Ruby and Chef I'm having trouble understanding how to get nested elements out of a databag (chef_vault). I think this is more a fundamental Ruby question, but not sure if somewhat Chef specific. I created this vault: $json = '{ "KEY1":…
red888
  • 27,709
  • 55
  • 204
  • 392
0
votes
1 answer

How convert Bag to fields in pig

I Have a data coming from UDF as bag Output:({(http://www.myurl.com 1000 1000)}) How do I generate 3 different fields from this bag as url, height,width.
0
votes
2 answers

Chef data bags (JSON): how to use one file with multiple items

I'm trying to use only one file in my Data Bag to contain multiple items (specifically for the users cookbook). All samples show isolated JSON objects. How do I store multiple ones in one file? I've tried { "id": "1" }, { "id": "2" } and [ …
aaro
  • 11
  • 4