Override argument

Hi,

What is the contract for the -o argument on chef-client? Can I expect that the only thing that changes between running ‘chef-client’ and ‘chef-client -o “recipe[something]”’, is the recipes that will get run?

Florian Hehlen

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word “misdirected” as the subject and delete this communication from your system.

Hi Flo,

    Ya, it gets run.

chef-client -o “recipe[something]”

the above command runs a chef-client with given runlist .

You can also refer this by

“chef-client -h” —which shows a what are all parameters we can run with chef-client.

Thanks,
Indra


From: Florian Hehlen Florian.Hehlen@mri-group.com
To: "chef@lists.opscode.com" chef@lists.opscode.com
Sent: Tuesday, 17 June 2014 3:42 PM
Subject: [chef] override argument

Hi,

What is the contract for the –o argument on chef-client? Can I expect that the only thing that changes between running ‘chef-client’ and ‘chef-client –o “recipe[something]”’, is the recipes that will get run?

Florian Hehlen

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender
by replying to this electronic communication inserting the word “misdirected” as the subject and delete this communication from your system.

HI,

Thank you Indra. I am aware of the feature. I am just wondering if it’s safe to use –o or is it really only for testing.

Florian

From: Indra k [mailto:indra.k@cloudenablers.com]
Sent: 17 June 2014 13:10
To: chef@lists.opscode.com
Subject: [chef] Re: override argument

Hi Flo,

    Ya, it gets run.

chef-client -o “recipe[something]”

the above command runs a chef-client with given runlist .

You can also refer this by

“chef-client -h” —which shows a what are all parameters we can run with chef-client.

Thanks,
Indra


From: Florian Hehlen <Florian.Hehlen@mri-group.commailto:Florian.Hehlen@mri-group.com>
To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Sent: Tuesday, 17 June 2014 3:42 PM
Subject: [chef] override argument

Hi,

What is the contract for the –o argument on chef-client? Can I expect that the only thing that changes between running ‘chef-client’ and ‘chef-client –o “recipe[something]”’, is the recipes that will get run?

Florian Hehlen

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word “misdirected” as the subject and delete this communication from your system.

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word “misdirected” as the subject and delete this communication from your system.

You want to use -o when you want to run something that is not assigned in the nodes run list or role. So say I have a base role, and I have a new recipe that I would like to test/run. I use chef-client -o "recipe[openssh]", this will run this recipe only once and then revert back to the nodes run list and will only run base.

--
Edward Valencia

On Tuesday, June 17, 2014 at 9:47 AM, Florian Hehlen wrote:

HI,

Thank you Indra. I am aware of the feature. I am just wondering if it’s safe to use –o or is it really only for testing.

Florian

From: Indra k [mailto:indra.k@cloudenablers.com]
Sent: 17 June 2014 13:10
To: chef@lists.opscode.com (mailto:chef@lists.opscode.com)
Subject: [chef] Re: override argument

Hi Flo,

    Ya, it gets run.

chef-client -o "recipe[something]"

the above command runs a chef-client with given runlist .

You can also refer this by

"chef-client -h" ---which shows a what are all parameters we can run with chef-client.

Thanks,
Indra

From: Florian Hehlen <Florian.Hehlen@mri-group.com (mailto:Florian.Hehlen@mri-group.com)>
To: "chef@lists.opscode.com (mailto:chef@lists.opscode.com)" <chef@lists.opscode.com (mailto:chef@lists.opscode.com)>
Sent: Tuesday, 17 June 2014 3:42 PM
Subject: [chef] override argument

Hi,

What is the contract for the –o argument on chef-client? Can I expect that the only thing that changes between running ‘chef-client’ and ‘chef-client –o “recipe[something]”’, is the recipes that will get run?

Florian Hehlen

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.

You can compose your roles such that you apply
'role[base],role[app1],role[app2]' to a server. The 'base' role may
install user accounts, security settings, resolv.conf, logrotation for
system logs, etc and other stuff not necessarily directly about running
the app. The application roles should install the prerequisites for the
app and deploy the app itself. In order to immediately deploy 'app1' you
can run "chef-client -o 'role[app1]'" which will only run the stuff
necessary to deploy app1 and will skip running the rest of the recipes
in the base role or for app2. That will allow chef to complete
deploying app1 much faster.

You probably do not want to overuse override run lists. They're for
doing-a-piece-of-the-whole-run-list-right-now, and only doing that
occasionally on demand.

On 6/17/14, 9:47 AM, Florian Hehlen wrote:

HI,

Thank you Indra. I am aware of the feature. I am just wondering if
it’s safe to use –o or is it really only for testing.

Florian

*From:*Indra k [mailto:indra.k@cloudenablers.com]
Sent: 17 June 2014 13:10
To: chef@lists.opscode.com
Subject: [chef] Re: override argument

Hi Flo,

    Ya, it gets run.

chef-client -o "recipe[something]"

the above command runs a chef-client with given runlist .

You can also refer this by

"chef-client -h" ---which shows a what are all parameters we can
run with chef-client.

Thanks,
Indra


*From:*Florian Hehlen <Florian.Hehlen@mri-group.com
mailto:Florian.Hehlen@mri-group.com>
To: "chef@lists.opscode.com mailto:chef@lists.opscode.com"
<chef@lists.opscode.com mailto:chef@lists.opscode.com>
Sent: Tuesday, 17 June 2014 3:42 PM
Subject: [chef] override argument

Hi,

What is the contract for the –o argument on chef-client? Can I expect
that the only thing that changes between running ‘chef-client’ and
‘chef-client –o “recipe[something]”’, is the recipes that will get run?

Florian Hehlen

LEGAL DISCLAIMER
This communication and any attached documents are strictly
confidential and/or legally privileged and they may not be used or
disclosed by someone who is not a named recipient. If you have
received this electronic communication in error please notify the
sender by replying to this electronic communication inserting the word
"misdirected" as the subject and delete this communication from your
system.

LEGAL DISCLAIMER
This communication and any attached documents are strictly
confidential and/or legally privileged and they may not be used or
disclosed by someone who is not a named recipient. If you have
received this electronic communication in error please notify the
sender by replying to this electronic communication inserting the word
"misdirected" as the subject and delete this communication from your
system.

The only caveat with -o is that it will modify the "recipes" field on the
node object. If you are relying on that for anything, then you may want to
be careful using -o.

On Tue, Jun 17, 2014 at 10:07 AM, Lamont Granquist lamont@opscode.com
wrote:

You can compose your roles such that you apply
'role[base],role[app1],role[app2]' to a server. The 'base' role may
install user accounts, security settings, resolv.conf, logrotation for
system logs, etc and other stuff not necessarily directly about running the
app. The application roles should install the prerequisites for the app
and deploy the app itself. In order to immediately deploy 'app1' you can
run "chef-client -o 'role[app1]'" which will only run the stuff necessary
to deploy app1 and will skip running the rest of the recipes in the base
role or for app2. That will allow chef to complete deploying app1 much
faster.

You probably do not want to overuse override run lists. They're for
doing-a-piece-of-the-whole-run-list-right-now, and only doing that
occasionally on demand.

On 6/17/14, 9:47 AM, Florian Hehlen wrote:

HI,

Thank you Indra. I am aware of the feature. I am just wondering if it’s
safe to use –o or is it really only for testing.

Florian

From: Indra k [mailto:indra.k@cloudenablers.com
indra.k@cloudenablers.com]
Sent: 17 June 2014 13:10
To: chef@lists.opscode.com
Subject: [chef] Re: override argument

Hi Flo,

    Ya, it gets run.

chef-client -o "recipe[something]"

the above command runs a chef-client with given runlist .

You can also refer this by

"chef-client -h" ---which shows a what are all parameters we can run
with chef-client.

Thanks,
Indra


From: Florian Hehlen Florian.Hehlen@mri-group.com
To: "chef@lists.opscode.com" chef@lists.opscode.com
Sent: Tuesday, 17 June 2014 3:42 PM
Subject: [chef] override argument

Hi,

What is the contract for the –o argument on chef-client? Can I expect that
the only thing that changes between running ‘chef-client’ and ‘chef-client
–o “recipe[something]”’, is the recipes that will get run?

Florian Hehlen

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential
and/or legally privileged and they may not be used or disclosed by someone
who is not a named recipient. If you have received this electronic
communication in error please notify the sender by replying to this
electronic communication inserting the word "misdirected" as the subject
and delete this communication from your system.

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential
and/or legally privileged and they may not be used or disclosed by someone
who is not a named recipient. If you have received this electronic
communication in error please notify the sender by replying to this
electronic communication inserting the word "misdirected" as the subject
and delete this communication from your system.

No, it is not amenable for general use. The biggest issue that override mode disables saving the node data back up to the server. This is done to avoid polluting the data on the server as not all recipes were executed, which might disrupt node searches and such. If you want to make conditional recipes, you can do that with something like:

return if node['skip_foo']

at the top of the recipe file.

--Noah

On Jun 17, 2014, at 9:47 AM, Florian Hehlen Florian.Hehlen@mri-group.com wrote:

HI,

Thank you Indra. I am aware of the feature. I am just wondering if it’s safe to use –o or is it really only for testing.

Florian

From: Indra k [mailto:indra.k@cloudenablers.com]
Sent: 17 June 2014 13:10
To: chef@lists.opscode.com
Subject: [chef] Re: override argument

Hi Flo,

    Ya, it gets run.

chef-client -o "recipe[something]"

the above command runs a chef-client with given runlist .

You can also refer this by

"chef-client -h" ---which shows a what are all parameters we can run with chef-client.

Thanks,
Indra

From: Florian Hehlen Florian.Hehlen@mri-group.com
To: "chef@lists.opscode.com" chef@lists.opscode.com
Sent: Tuesday, 17 June 2014 3:42 PM
Subject: [chef] override argument

Hi,

What is the contract for the –o argument on chef-client? Can I expect that the only thing that changes between running ‘chef-client’ and ‘chef-client –o “recipe[something]”’, is the recipes that will get run?

Florian Hehlen

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.

LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.