Sha256: 9bb9c08c42f2afde4ba3a34dcc7a70c2d3cc667c3fd49ddc05c099292b783c4e

Contents?: true

Size: 1.91 KB

Versions: 81

Compression:

Stored size: 1.91 KB

Contents

# Data Bags

This directory contains directories of the various data bags you create for your infrastructure. Each subdirectory corresponds to a data bag on the Chef Server, and contains JSON files of the items that go in the bag.

For example, in this directory you'll find an example data bag directory called `example`, which contains an item definition called `example_item.json`

Before uploading this item to the server, we must first create the data bag on the Chef Server.

    knife data bag create example

Then we can upload the items in the data bag's directory to the Chef Server.

    knife data bag from file example example_item.json

For more information on data bags, see the Chef wiki page:

https://docs.chef.io/data_bags.html

# Encrypted Data Bags

Encrypted data bags allow you to encrypt the contents of your data bags. The content of attributes will no longer be searchable. To use encrypted data bags, first you must have or create a secret key.

    openssl rand -base64 512 > secret_key

You may use this secret_key to add items to a data bag during a create.

    knife data bag create --secret-file secret_key passwords mysql

You may also use it when adding ITEMs from files,

    knife data bag create passwords
    knife data bag from file passwords data_bags/passwords/mysql.json --secret-file secret_key

The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM" and the contents will be encrypted when uploaded. For example,

    {
      "id": "mysql",
      "password": "abc123"
    }

Without the secret_key, the contents are encrypted.

    knife data bag show passwords mysql
    id:        mysql
    password:  2I0XUUve1TXEojEyeGsjhw==

Use the secret_key to view the contents.

    knife data bag show passwords mysql --secret-file secret_key
    id:        mysql
    password:  abc123


For more information on encrypted data bags, see the Chef wiki page:

https://docs.chef.io/data_bags.html

Version data entries

81 entries across 81 versions & 4 rubygems

Version Path
chef-dk-3.0.36 lib/chef-dk/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.1.0 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.21 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.20 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.19 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.18 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.17 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.16 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.15 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.14 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.13 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.12 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.11 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.10 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.8 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.7 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.6 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.5 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.4 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md
idlc-sdk-pfm-1.0.3 lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md