How to upload ALL encrypted data bags to Chef server?

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

I see mention of the -a/–all option here so I tried

$ knife data bag from file -all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO data bag is uploaded.

Chris

Are the files actually different to what exists on the server? I know with
knife upload it only outputs if it creates or modifies a file. What's the
exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

knife data bag

I see mention of the -a/--all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO
data bag is uploaded.

Chris

--
Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025
Email: yoshi.spendiff@indochino.com

I’m not using “knife upload” since that command doesn’t seem to have the option to upload encrypted data bags. Rather “knife data bag.” There are NO data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef server?

Are the files actually different to what exists on the server? I know with knife upload it only outputs if it creates or modifies a file. What’s the exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
https://docs.chef.io/knife_data_bag.html

I see mention of the -a/–all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO data bag is uploaded.

Chris


Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025
Email: yoshi.spendiff@indochino.commailto:yoshi.spendiff@indochino.com

Knife upload will upload encrypted data bags. You just need to "knife data
bag edit somebag someitem --secret-file=somesecret" and then "knife data
bag show somebag someitem -Fj > someitem.json" (note, not specifying the
secret file, otherwise you'll decrypt it). That's how we handle it, at
least... that way the encrypted bags are still inside git, which is our
Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through "knife data bag edit"
would be much preferable, however.

--
~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I’m not using “knife upload” since that command doesn’t seem to have the
option to upload encrypted data bags. Rather “knife data bag.” There are NO
data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef
server?

Are the files actually different to what exists on the server? I know with
knife upload it only outputs if it creates or modifies a file. What's the
exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

knife data bag

I see mention of the -a/--all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO
data bag is uploaded.

Chris

--

Yoshi Spendiff

Ops Engineer

Indochino

Mobile: +1 778 952 2025

Email: yoshi.spendiff@indochino.com

can you try setting the data_bags_path in knife config. and omit it from
the command line?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

knife data bag

I see mention of the -a/--all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO
data bag is uploaded.

Chris

There are NO data bags in the server YET, so knife data bag edit will NOT work? I’m trying to upload ALL the encrypted data bags for the FIRST time.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 3:52 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: How to upload ALL encrypted data bags to Chef server?

Knife upload will upload encrypted data bags. You just need to “knife data bag edit somebag someitem --secret-file=somesecret” and then “knife data bag show somebag someitem -Fj > someitem.json” (note, not specifying the secret file, otherwise you’ll decrypt it). That’s how we handle it, at least… that way the encrypted bags are still inside git, which is our Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through “knife data bag edit” would be much preferable, however.


~~ StormeRider ~~
“Every world needs its heroes […] They inspire us to be better than we are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
I’m not using “knife upload” since that command doesn’t seem to have the option to upload encrypted data bags. Rather “knife data bag.” There are NO data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.commailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef server?

Are the files actually different to what exists on the server? I know with knife upload it only outputs if it creates or modifies a file. What’s the exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
https://docs.chef.io/knife_data_bag.html

I see mention of the -a/–all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO data bag is uploaded.

Chris


Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025tel:%2B1%20778%20952%202025
Email: yoshi.spendiff@indochino.commailto:yoshi.spendiff@indochino.com

Well, then knife data bag create. Same approach.

--
~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:58 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

There are NO data bags in the server YET, so knife data bag edit will
NOT work? I’m trying to upload ALL the encrypted data bags for the FIRST
time.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 3:52 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: How to upload ALL encrypted data bags to
Chef server?

Knife upload will upload encrypted data bags. You just need to "knife data
bag edit somebag someitem --secret-file=somesecret" and then "knife data
bag show somebag someitem -Fj > someitem.json" (note, not specifying the
secret file, otherwise you'll decrypt it). That's how we handle it, at
least... that way the encrypted bags are still inside git, which is our
Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through "knife data bag edit"
would be much preferable, however.

--

~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I’m not using “knife upload” since that command doesn’t seem to have the
option to upload encrypted data bags. Rather “knife data bag.” There are NO
data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef
server?

Are the files actually different to what exists on the server? I know with
knife upload it only outputs if it creates or modifies a file. What's the
exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

knife data bag

I see mention of the -a/--all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO
data bag is uploaded.

Chris

--

Yoshi Spendiff

Ops Engineer

Indochino

Mobile: +1 778 952 2025

Email: yoshi.spendiff@indochino.com

Now I’ll have to do a knife data bag create for “EACH” data bag? AVOIDING this was the point of my question. I was trying to figure out a way, if it exists, to NOT do this. The docs seem to suggest there’s a way, but are they misleading and there really isn’t one?

Here’s part of the docs

$ knife data bag from file DATA_BAG_NAME_or_PATH
Options
This argument has the following options:
-a, --all
Use to upload all data bags found at the specified path.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 4:03 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: Re: How to upload ALL encrypted data bags to Chef server?

Well, then knife data bag create. Same approach.


~~ StormeRider ~~
“Every world needs its heroes […] They inspire us to be better than we are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:58 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
There are NO data bags in the server YET, so knife data bag edit will NOT work? I’m trying to upload ALL the encrypted data bags for the FIRST time.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.commailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 3:52 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: RE: Re: How to upload ALL encrypted data bags to Chef server?

Knife upload will upload encrypted data bags. You just need to “knife data bag edit somebag someitem --secret-file=somesecret” and then “knife data bag show somebag someitem -Fj > someitem.json” (note, not specifying the secret file, otherwise you’ll decrypt it). That’s how we handle it, at least… that way the encrypted bags are still inside git, which is our Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through “knife data bag edit” would be much preferable, however.


~~ StormeRider ~~
“Every world needs its heroes […] They inspire us to be better than we are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
I’m not using “knife upload” since that command doesn’t seem to have the option to upload encrypted data bags. Rather “knife data bag.” There are NO data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.commailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef server?

Are the files actually different to what exists on the server? I know with knife upload it only outputs if it creates or modifies a file. What’s the exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
https://docs.chef.io/knife_data_bag.html

I see mention of the -a/–all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO data bag is uploaded.

Chris


Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025tel:%2B1%20778%20952%202025
Email: yoshi.spendiff@indochino.commailto:yoshi.spendiff@indochino.com

can you open a ticket on github, i think this is a neat feature to have, we
can add a flag to create the databag if absent,

cheers
ranjib

On Mon, Apr 27, 2015 at 2:31 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

Now I’ll have to do a knife data bag create for “EACH” data bag?
AVOIDING this was the point of my question. I was trying to figure out a
way, if it exists, to NOT do this. The docs seem to suggest there’s a way,
but are they misleading and there really isn’t one?

Here’s part of the docs

$ knife data bag from file DATA_BAG_NAME_or_PATH

Options

This argument has the following options:

-a, --all

Use to upload all data bags found at the specified path.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 4:03 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: Re: How to upload ALL encrypted data
bags to Chef server?

Well, then knife data bag create. Same approach.

--

~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:58 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

There are NO data bags in the server YET, so knife data bag edit will NOT
work? I’m trying to upload ALL the encrypted data bags for the FIRST time.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 3:52 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: How to upload ALL encrypted data bags to
Chef server?

Knife upload will upload encrypted data bags. You just need to "knife data
bag edit somebag someitem --secret-file=somesecret" and then "knife data
bag show somebag someitem -Fj > someitem.json" (note, not specifying the
secret file, otherwise you'll decrypt it). That's how we handle it, at
least... that way the encrypted bags are still inside git, which is our
Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through "knife data bag edit"
would be much preferable, however.

--

~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I’m not using “knife upload” since that command doesn’t seem to have the
option to upload encrypted data bags. Rather “knife data bag.” There are NO
data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef
server?

Are the files actually different to what exists on the server? I know with
knife upload it only outputs if it creates or modifies a file. What's the
exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

knife data bag

I see mention of the -a/--all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO
data bag is uploaded.

Chris

--

Yoshi Spendiff

Ops Engineer

Indochino

Mobile: +1 778 952 2025

Email: yoshi.spendiff@indochino.com

I use this all the time

knife data bag from file dev ./data_bags/dev/dev.json

On Mon, Apr 27, 2015 at 2:38 PM, Ranjib Dey dey.ranjib@gmail.com wrote:

can you open a ticket on github, i think this is a neat feature to have,
we can add a flag to create the databag if absent,

cheers
ranjib

On Mon, Apr 27, 2015 at 2:31 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

Now I’ll have to do a knife data bag create for “EACH” data bag?
AVOIDING this was the point of my question. I was trying to figure out a
way, if it exists, to NOT do this. The docs seem to suggest there’s a way,
but are they misleading and there really isn’t one?

Here’s part of the docs

$ knife data bag from file DATA_BAG_NAME_or_PATH

Options

This argument has the following options:

-a, --all

Use to upload all data bags found at the specified path.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 4:03 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: Re: How to upload ALL encrypted data
bags to Chef server?

Well, then knife data bag create. Same approach.

--

~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:58 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

There are NO data bags in the server YET, so knife data bag edit will NOT
work? I’m trying to upload ALL the encrypted data bags for the FIRST time.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 3:52 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: How to upload ALL encrypted data bags to
Chef server?

Knife upload will upload encrypted data bags. You just need to "knife
data bag edit somebag someitem --secret-file=somesecret" and then "knife
data bag show somebag someitem -Fj > someitem.json" (note, not specifying
the secret file, otherwise you'll decrypt it). That's how we handle it, at
least... that way the encrypted bags are still inside git, which is our
Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through "knife data bag
edit" would be much preferable, however.

--

~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I’m not using “knife upload” since that command doesn’t seem to have the
option to upload encrypted data bags. Rather “knife data bag.” There are NO
data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef
server?

Are the files actually different to what exists on the server? I know
with knife upload it only outputs if it creates or modifies a file. What's
the exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

knife data bag

I see mention of the -a/--all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO
data bag is uploaded.

Chris

--

Yoshi Spendiff

Ops Engineer

Indochino

Mobile: +1 778 952 2025

Email: yoshi.spendiff@indochino.com

--
Regards
nirish okram

I will open a feature request yes.

It IS my misunderstanding though. This works.

$ knife data bag from file bag_name –all –secret-file SECRET_FILE

IOW I thought I could upload all the data bags in the data_bags dir with above command. However, it only works for upload all the “data bag items” under that data bag.

Chris

From: Ranjib Dey [mailto:dey.ranjib@gmail.com]
Sent: Monday, April 27, 2015 5:38 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: Re: RE: Re: How to upload ALL encrypted data bags to Chef server?

can you open a ticket on github, i think this is a neat feature to have, we can add a flag to create the databag if absent,

cheers
ranjib

On Mon, Apr 27, 2015 at 2:31 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
Now I’ll have to do a knife data bag create for “EACH” data bag? AVOIDING this was the point of my question. I was trying to figure out a way, if it exists, to NOT do this. The docs seem to suggest there’s a way, but are they misleading and there really isn’t one?

Here’s part of the docs

$ knife data bag from file DATA_BAG_NAME_or_PATH
Options
This argument has the following options:
-a, --all
Use to upload all data bags found at the specified path.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.commailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 4:03 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: Re: How to upload ALL encrypted data bags to Chef server?

Well, then knife data bag create. Same approach.


~~ StormeRider ~~
“Every world needs its heroes […] They inspire us to be better than we are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:58 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
There are NO data bags in the server YET, so knife data bag edit will NOT work? I’m trying to upload ALL the encrypted data bags for the FIRST time.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.commailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 3:52 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: RE: Re: How to upload ALL encrypted data bags to Chef server?

Knife upload will upload encrypted data bags. You just need to “knife data bag edit somebag someitem --secret-file=somesecret” and then “knife data bag show somebag someitem -Fj > someitem.json” (note, not specifying the secret file, otherwise you’ll decrypt it). That’s how we handle it, at least… that way the encrypted bags are still inside git, which is our Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through “knife data bag edit” would be much preferable, however.


~~ StormeRider ~~
“Every world needs its heroes […] They inspire us to be better than we are. And they protect from the darkness that’s just around the corner.”

(from Smallville Season 6x1: “Zod”)

On why I hate the phrase “that’s so lame”… http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
I’m not using “knife upload” since that command doesn’t seem to have the option to upload encrypted data bags. Rather “knife data bag.” There are NO data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.commailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef server?

Are the files actually different to what exists on the server? I know with knife upload it only outputs if it creates or modifies a file. What’s the exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
https://docs.chef.io/knife_data_bag.html

I see mention of the -a/–all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO data bag is uploaded.

Chris


Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025tel:%2B1%20778%20952%202025
Email: yoshi.spendiff@indochino.commailto:yoshi.spendiff@indochino.com

I have used for-loops for handling multi-item creation. Not the best
solution (I would like it to be a feature, to generate bags if not present)

On Mon, Apr 27, 2015 at 7:13 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I will open a feature request yes.

It IS my misunderstanding though. This works.

$ knife data bag from file bag_name –all –secret-file SECRET_FILE

IOW I thought I could upload all the data bags in the data_bags dir with
above command. However, it only works for upload all the “data bag items”
under that data bag.

Chris

From: Ranjib Dey [mailto:dey.ranjib@gmail.com]
Sent: Monday, April 27, 2015 5:38 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: Re: RE: Re: How to upload ALL encrypted
data bags to Chef server?

can you open a ticket on github, i think this is a neat feature to have,
we can add a flag to create the databag if absent,

cheers

ranjib

On Mon, Apr 27, 2015 at 2:31 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

Now I’ll have to do a knife data bag create for “EACH” data bag? AVOIDING
this was the point of my question. I was trying to figure out a way, if it
exists, to NOT do this. The docs seem to suggest there’s a way, but are
they misleading and there really isn’t one?

Here’s part of the docs

$ knife data bag from file DATA_BAG_NAME_or_PATH

Options

This argument has the following options:

-a, --all

Use to upload all data bags found at the specified path.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 4:03 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: RE: Re: How to upload ALL encrypted data
bags to Chef server?

Well, then knife data bag create. Same approach.

--

~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:58 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

There are NO data bags in the server YET, so knife data bag edit will NOT
work? I’m trying to upload ALL the encrypted data bags for the FIRST time.

Chris

From: Morgan Blackthorne [mailto:stormerider@gmail.com]
Sent: Monday, April 27, 2015 3:52 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: How to upload ALL encrypted data bags to
Chef server?

Knife upload will upload encrypted data bags. You just need to "knife data
bag edit somebag someitem --secret-file=somesecret" and then "knife data
bag show somebag someitem -Fj > someitem.json" (note, not specifying the
secret file, otherwise you'll decrypt it). That's how we handle it, at
least... that way the encrypted bags are still inside git, which is our
Source of Truth, but only in the encrypted form.

Being able to encrypt the bags without going through "knife data bag edit"
would be much preferable, however.

--

~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Mon, Apr 27, 2015 at 12:38 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I’m not using “knife upload” since that command doesn’t seem to have the
option to upload encrypted data bags. Rather “knife data bag.” There are NO
data bags in the server. Like I said, the command gives NO feedback.

Chris

From: Yoshi Spendiff [mailto:yoshi.spendiff@indochino.com]
Sent: Monday, April 27, 2015 3:29 PM
To: chef@lists.opscode.com
Subject: [chef] Re: How to upload ALL encrypted data bags to Chef
server?

Are the files actually different to what exists on the server? I know with
knife upload it only outputs if it creates or modifies a file. What's the
exit code of the command?

On Mon, Apr 27, 2015 at 12:09 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

knife data bag

I see mention of the -a/--all option here so I tried

$ knife data bag from file –all --secret-file

But I get no command feedback, netiher pass nor fail. Moreover, the NO
data bag is uploaded.

Chris

--

Yoshi Spendiff

Ops Engineer

Indochino

Mobile: +1 778 952 2025

Email: yoshi.spendiff@indochino.com

--

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544