Chef-solo runs break on server searches


#1

Hi! Anyone know of a way to get ch-solo to work when a chef cookbook does
a earch on the server? Is it possible to have a chef-solo run use
cookbooks locally, but run it’s searches on the server? Is it possible to
download the data as a json file and point search queries at that?

Any thoughts/recommendations are appreciated!!

Thanks a lot,
Guy


#2

have you looked at --local-mode ? . I am not up to date, but i can recall
this being discussed on the mailing lists, so it might be already there.

i can think of following:

  1. write a library that exposes a custom search method (say x_search) that
    uses chef api to do searching. include this in chef recipes. you have to
    drop additional client cert for the x_search library.

  2. use chef zero to upload the searchable data and then search against it.
    (this will be considerably slow, as you are spawning the chef zero server
    on demand). you have to sort out how to distribute the search data.,
    you’ll need a wrapper library here as well. …but this will allow you to
    grab data, upload it in chef-zero and search against it.

cheers
ranjib

On Mon, Jan 13, 2014 at 12:57 PM, Guy Matz guymatz@gmail.com wrote:

Hi! Anyone know of a way to get ch-solo to work when a chef cookbook does
a earch on the server? Is it possible to have a chef-solo run use
cookbooks locally, but run it’s searches on the server? Is it possible to
download the data as a json file and point search queries at that?

Any thoughts/recommendations are appreciated!!

Thanks a lot,
Guy


#3

Thanks! There doesn’t seem to be a local-mode for my chef-solo:

[vagrant@default-centos-64 keys] sudo -E chef-solo --help Usage: /usr/bin/chef-solo (options) -f, --[no-]fork Fork client --[no-]color Use colored output, defaults to enabled -c, --config CONFIG The configuration file to use -d, --daemonize Daemonize the process -E, --environment ENVIRONMENT Set the Chef Environment on the node --force-formatter Use formatter output instead of logger output --force-logger Use logger output instead of formatter output -F, --format FORMATTER output format to use -g, --group GROUP Group to set privilege to -i, --interval SECONDS Run chef-client periodically, in seconds -j JSON_ATTRIBS, Load attributes from a JSON file or URL --json-attributes -l, --log_level LEVEL Set the log level (debug, info, warn, error, fatal) -L, --logfile LOGLOCATION Set the log file location, defaults to STDOUT -N, --node-name NODE_NAME The node name for this client -o RunlistItem,RunlistItem..., Replace current run list with specified items --override-runlist -r, --recipe-url RECIPE_URL Pull down a remote gzipped tarball of recipes and untar it to the cookbook cache. -s, --splay SECONDS The splay time for running at intervals, in seconds -u, --user USER User to set privilege to -v, --version Show chef version -W, --why-run Enable whyrun mode -h, --help Show this message [vagrant@default-centos-64 keys] chef-solo --version
Chef: 11.8.2

On Mon, Jan 13, 2014 at 4:12 PM, Ranjib Dey dey.ranjib@gmail.com wrote:

have you looked at --local-mode ? . I am not up to date, but i can recall
this being discussed on the mailing lists, so it might be already there.

i can think of following:

  1. write a library that exposes a custom search method (say x_search) that
    uses chef api to do searching. include this in chef recipes. you have to
    drop additional client cert for the x_search library.

  2. use chef zero to upload the searchable data and then search against it.
    (this will be considerably slow, as you are spawning the chef zero server
    on demand). you have to sort out how to distribute the search data.,
    you’ll need a wrapper library here as well. …but this will allow you to
    grab data, upload it in chef-zero and search against it.

cheers
ranjib

On Mon, Jan 13, 2014 at 12:57 PM, Guy Matz guymatz@gmail.com wrote:

Hi! Anyone know of a way to get ch-solo to work when a chef cookbook
does a earch on the server? Is it possible to have a chef-solo run use
cookbooks locally, but run it’s searches on the server? Is it possible to
download the data as a json file and point search queries at that?

Any thoughts/recommendations are appreciated!!

Thanks a lot,
Guy


#4

local mode is an option for chef-client, it spins up a chef-zero server in the background so there’s no communication to an outside chef-server.


Daniel DeLeo

On Monday, January 13, 2014 at 1:39 PM, Guy Matz wrote:

Thanks! There doesn’t seem to be a local-mode for my chef-solo:

[vagrant@default-centos-64 keys] sudo -E chef-solo --help Usage: /usr/bin/chef-solo (options) -f, --[no-]fork Fork client --[no-]color Use colored output, defaults to enabled -c, --config CONFIG The configuration file to use -d, --daemonize Daemonize the process -E, --environment ENVIRONMENT Set the Chef Environment on the node --force-formatter Use formatter output instead of logger output --force-logger Use logger output instead of formatter output -F, --format FORMATTER output format to use -g, --group GROUP Group to set privilege to -i, --interval SECONDS Run chef-client periodically, in seconds -j JSON_ATTRIBS, Load attributes from a JSON file or URL --json-attributes -l, --log_level LEVEL Set the log level (debug, info, warn, error, fatal) -L, --logfile LOGLOCATION Set the log file location, defaults to STDOUT -N, --node-name NODE_NAME The node name for this client -o RunlistItem,RunlistItem..., Replace current run list with specified items --override-runlist -r, --recipe-url RECIPE_URL Pull down a remote gzipped tarball of recipes and untar it to the cookbook cache. -s, --splay SECONDS The splay time for running at intervals, in seconds -u, --user USER User to set privilege to -v, --version Show chef version -W, --why-run Enable whyrun mode -h, --help Show this message [vagrant@default-centos-64 keys] chef-solo --version
Chef: 11.8.2

On Mon, Jan 13, 2014 at 4:12 PM, Ranjib Dey <dey.ranjib@gmail.com (mailto:dey.ranjib@gmail.com)> wrote:

have you looked at --local-mode ? . I am not up to date, but i can recall this being discussed on the mailing lists, so it might be already there.

i can think of following:

  1. write a library that exposes a custom search method (say x_search) that uses chef api to do searching. include this in chef recipes. you have to drop additional client cert for the x_search library.

  2. use chef zero to upload the searchable data and then search against it. (this will be considerably slow, as you are spawning the chef zero server on demand). you have to sort out how to distribute the search data., you’ll need a wrapper library here as well. …but this will allow you to grab data, upload it in chef-zero and search against it.

cheers
ranjib

On Mon, Jan 13, 2014 at 12:57 PM, Guy Matz <guymatz@gmail.com (mailto:guymatz@gmail.com)> wrote:

Hi! Anyone know of a way to get ch-solo to work when a chef cookbook does a earch on the server? Is it possible to have a chef-solo run use cookbooks locally, but run it’s searches on the server? Is it possible to download the data as a json file and point search queries at that?

Any thoughts/recommendations are appreciated!!

Thanks a lot,
Guy


#5

Yeah, I think this is exactly what I was looking for!

Thanks for the pointer!

On Mon, Jan 13, 2014 at 4:48 PM, Daniel DeLeo dan@kallistec.com wrote:

local mode is an option for chef-client, it spins up a chef-zero server
in the background so there’s no communication to an outside chef-server.


Daniel DeLeo

On Monday, January 13, 2014 at 1:39 PM, Guy Matz wrote:

Thanks! There doesn’t seem to be a local-mode for my chef-solo:

[vagrant@default-centos-64 keys] sudo -E chef-solo --help Usage: /usr/bin/chef-solo (options) -f, --[no-]fork Fork client --[no-]color Use colored output, defaults to enabled -c, --config CONFIG The configuration file to use -d, --daemonize Daemonize the process -E, --environment ENVIRONMENT Set the Chef Environment on the node --force-formatter Use formatter output instead of logger output --force-logger Use logger output instead of formatter output -F, --format FORMATTER output format to use -g, --group GROUP Group to set privilege to -i, --interval SECONDS Run chef-client periodically, in seconds -j JSON_ATTRIBS, Load attributes from a JSON file or URL --json-attributes -l, --log_level LEVEL Set the log level (debug, info, warn, error, fatal) -L, --logfile LOGLOCATION Set the log file location, defaults to STDOUT -N, --node-name NODE_NAME The node name for this client -o RunlistItem,RunlistItem..., Replace current run list with specified items --override-runlist -r, --recipe-url RECIPE_URL Pull down a remote gzipped tarball of recipes and untar it to the cookbook cache. -s, --splay SECONDS The splay time for running at intervals, in seconds -u, --user USER User to set privilege to -v, --version Show chef version -W, --why-run Enable whyrun mode -h, --help Show this message [vagrant@default-centos-64 keys] chef-solo --version
Chef: 11.8.2

On Mon, Jan 13, 2014 at 4:12 PM, Ranjib Dey dey.ranjib@gmail.com wrote:

have you looked at --local-mode ? . I am not up to date, but i can recall
this being discussed on the mailing lists, so it might be already there.

i can think of following:

  1. write a library that exposes a custom search method (say x_search) that
    uses chef api to do searching. include this in chef recipes. you have to
    drop additional client cert for the x_search library.

  2. use chef zero to upload the searchable data and then search against it.
    (this will be considerably slow, as you are spawning the chef zero server
    on demand). you have to sort out how to distribute the search data.,
    you’ll need a wrapper library here as well. …but this will allow you to
    grab data, upload it in chef-zero and search against it.

cheers
ranjib

On Mon, Jan 13, 2014 at 12:57 PM, Guy Matz guymatz@gmail.com wrote:

Hi! Anyone know of a way to get ch-solo to work when a chef cookbook does
a earch on the server? Is it possible to have a chef-solo run use
cookbooks locally, but run it’s searches on the server? Is it possible to
download the data as a json file and point search queries at that?

Any thoughts/recommendations are appreciated!!

Thanks a lot,
Guy


#6

You might also want to check out this:

HTH, Torben
On Jan 13, 2014 11:08 PM, “Guy Matz” guymatz@gmail.com wrote:

Yeah, I think this is exactly what I was looking for!
https://github.com/opscode/chef-zero

Thanks for the pointer!

On Mon, Jan 13, 2014 at 4:48 PM, Daniel DeLeo dan@kallistec.com wrote:

local mode is an option for chef-client, it spins up a chef-zero server
in the background so there’s no communication to an outside chef-server.


Daniel DeLeo

On Monday, January 13, 2014 at 1:39 PM, Guy Matz wrote:

Thanks! There doesn’t seem to be a local-mode for my chef-solo:

[vagrant@default-centos-64 keys] sudo -E chef-solo --help Usage: /usr/bin/chef-solo (options) -f, --[no-]fork Fork client --[no-]color Use colored output, defaults to enabled -c, --config CONFIG The configuration file to use -d, --daemonize Daemonize the process -E, --environment ENVIRONMENT Set the Chef Environment on the node --force-formatter Use formatter output instead of logger output --force-logger Use logger output instead of formatter output -F, --format FORMATTER output format to use -g, --group GROUP Group to set privilege to -i, --interval SECONDS Run chef-client periodically, in seconds -j JSON_ATTRIBS, Load attributes from a JSON file or URL --json-attributes -l, --log_level LEVEL Set the log level (debug, info, warn, error, fatal) -L, --logfile LOGLOCATION Set the log file location, defaults to STDOUT -N, --node-name NODE_NAME The node name for this client -o RunlistItem,RunlistItem..., Replace current run list with specified items --override-runlist -r, --recipe-url RECIPE_URL Pull down a remote gzipped tarball of recipes and untar it to the cookbook cache. -s, --splay SECONDS The splay time for running at intervals, in seconds -u, --user USER User to set privilege to -v, --version Show chef version -W, --why-run Enable whyrun mode -h, --help Show this message [vagrant@default-centos-64 keys] chef-solo --version
Chef: 11.8.2

On Mon, Jan 13, 2014 at 4:12 PM, Ranjib Dey dey.ranjib@gmail.com wrote:

have you looked at --local-mode ? . I am not up to date, but i can recall
this being discussed on the mailing lists, so it might be already there.

i can think of following:

  1. write a library that exposes a custom search method (say x_search)
    that uses chef api to do searching. include this in chef recipes. you have
    to drop additional client cert for the x_search library.

  2. use chef zero to upload the searchable data and then search against
    it. (this will be considerably slow, as you are spawning the chef zero
    server on demand). you have to sort out how to distribute the search
    data., you’ll need a wrapper library here as well. …but this will allow
    you to grab data, upload it in chef-zero and search against it.

cheers
ranjib

On Mon, Jan 13, 2014 at 12:57 PM, Guy Matz guymatz@gmail.com wrote:

Hi! Anyone know of a way to get ch-solo to work when a chef cookbook
does a earch on the server? Is it possible to have a chef-solo run use
cookbooks locally, but run it’s searches on the server? Is it possible to
download the data as a json file and point search queries at that?

Any thoughts/recommendations are appreciated!!

Thanks a lot,
Guy