Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a ChefZeroCapture kitchen provisioner #75

Merged
merged 1 commit into from
May 29, 2020
Merged

Conversation

marcparadise
Copy link
Member

@marcparadise marcparadise commented May 27, 2020

Description

This provisioner makes a chef captured node's
dependencies fully available to chef-zero by adding
support for policies, policy_groups, and cookbook_artifacts
to the provisioner.

This allows policy-managed nodes captured with chef capture to converge
in the same way as they do when running in their normal enviornment
without the kitchen provisioner performing any policyfile resolution
ahead of time.

This provisioner is only suitable for use with a captured node; in the normal case,
a node using chef-zero will want the current behavior of resolving policyfiles/berksfiles.

Signed-off-by: Marc A. Paradise marc.paradise@gmail.com

This provisioner makes a `chef capture`d node's
dependencies fully available to chef-zero by adding
support for policies, policy_groups, and cookbook_artifacts
to the provisioner.

This allows policy-managed nodes captured with `chef capture` to converge
in the same way as they do when running in their nornal enviornment
without the kitchen provisioner performing any policyfile resolution
ahead of time.

Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Copy link
Contributor

@jonsmorrow jonsmorrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading this correctly... It takes the directory of stuff we captured from a node and uses it to provision a kitchen instance. Looks good to me and much more clever approach than I was anticipating.

marcparadise added a commit to chef/chef-analyze that referenced this pull request May 28, 2020
This adds chef-capture support for policy-managed nodes.

It works int he same way that it does for non-policy-managed nodes -
it will capture the nodes state including , policy group/policy/cookbook
artifacts from a Chef Infra Server and make it available to the
captured note via test-kitchen.

This differs from running policyfile tests in TK
in that Kitchen itself won't attempt to resolve or
download any cookbook depenencies - it relies on chef capture having
saved that chef-server state  into the node repo before kitchen
converge.

This functionality relies on a new provisioner for TK, "chef_zero_capture". This
provisioner ships with chef-cli, and will be available once the
following PR merges:

chef/chef-cli#75

Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Copy link
Contributor

@tyler-ball tyler-ball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I specify this in my kitchen.yml?

provisioner:
  name: chef_zero_capture

?

@marcparadise
Copy link
Member Author

How do I specify this in my kitchen.yml?

provisioner:
  name: chef_zero_capture

Yep

@marcparadise marcparadise merged commit 713e12b into master May 29, 2020
@chef-expeditor chef-expeditor bot deleted the mp/CA-212 branch May 29, 2020 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants