[chef] RE: Re: RE: Re: RE: Re: RE: Re: How to upload ALL encrypted data bags to Chef server?


Chronological Thread 
  • From: "Fouts, Chris" < >
  • To: " " < >
  • Subject: [chef] RE: Re: RE: Re: RE: Re: RE: Re: How to upload ALL encrypted data bags to Chef server?
  • Date: Tue, 28 Apr 2015 02:13:36 +0000
  • Accept-language: en-US

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:
Sent: Monday, April 27, 2015 5:38 PM
To:
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 < " target="_blank"> > 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: " target="_blank"> ]
Sent: Monday, April 27, 2015 4:03 PM
To: " target="_blank">
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 < " target="_blank"> > 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: " target="_blank"> ]
Sent: Monday, April 27, 2015 3:52 PM
To: " target="_blank">
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 < " target="_blank"> > 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: " target="_blank"> ]
Sent: Monday, April 27, 2015 3:29 PM
To: " target="_blank">
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 < " target="_blank"> > 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 <path to data_bags> --secret-file <path to secret file>

 

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

 

Chris




--

 

 

 




Archive powered by MHonArc 2.6.16.

§