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

Generate cookbooks with Chef Infra Client 16 in the examples #70

Merged
merged 3 commits into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ gem_graph.png
.bundle

# ignore some common Bundler 'binstubs' directory names
# http://gembundler.com/man/bundle-exec.1.html
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a dead link

b/
binstubs/
vendor/
Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/clean_policy_cookbooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CleanPolicyCookbooks < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/clean_policy_revisions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CleanPolicyRevisions < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/delete_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DeletePolicy < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/delete_policy_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DeletePolicyGroup < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Export < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/generator_commands/cookbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def read_and_validate_params
if !@cookbook_name_or_path
@params_valid = false
elsif /-/ =~ File.basename(@cookbook_name_or_path)
msg("Hyphens are discouraged in cookbook names as they may cause problems with custom resources. See https://docs.chef.io/ctl_chef.html#chef-generate-cookbook for more information.")
msg("Hyphens are discouraged in cookbook names as they may cause problems with custom resources. See https://docs.chef.io/ctl_chef/#chef-generate-cookbook for more information.")
end

if config[:berks] && config[:policy]
Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Install < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Push < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/push_archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PushArchive < Base

For more information about Policyfiles, see our detailed README:

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

Options:
E
Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/show_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ShowPolicy < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/undelete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Undelete < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/command/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Update < Base

See our detailed README for more information:

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

Options:

Expand Down
2 changes: 1 addition & 1 deletion lib/chef-cli/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def license_description(comment = nil)
along with this program. If not, see <http://www.gnu.org/licenses/>.
EOH
else
raise ArgumentError, "Invalid generator.license setting: #{license}. See available licenses at https://docs.chef.io/ctl_chef.html#chef-generate-cookbook"
raise ArgumentError, "Invalid generator.license setting: #{license}. See available licenses at https://docs.chef.io/ctl_chef/#chef-generate-cookbook"
end
if comment
# Ensure there's no trailing whitespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repository contains several directories, and each directory contains a READ

# Configuration

The config file, `.chef/config.rb` is a repository-specific configuration file for the knife command line tool. If you're using the Hosted Chef platform, you can download one for your organization from the management console. You can also generate a new config.rb by running `knife configure`. For more information about configuring Knife, see the Knife documentation at https://docs.chef.io/knife.html
The config file, `.chef/config.rb` is a repository-specific configuration file for the knife command line tool. If you're using the Hosted Chef platform, you can download one for your organization from the management console. You can also generate a new config.rb by running `knife configure`. For more information about configuring Knife, see the Knife documentation at https://docs.chef.io/workstation/knife/

# Next Steps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Set a default name
default['example']['name'] = 'Sam Doe'

# For further information, see the Chef documentation (https://docs.chef.io/attributes.html).
# For further information, see the Chef Infra documentation (https://docs.chef.io/attributes/).
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
level :info
end

# For more information, see the documentation: https://docs.chef.io/recipes.html
# For more information, see the documentation: https://docs.chef.io/recipes
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Then we can upload the items in the data bag's directory to the Chef Infra Serve

knife data bag from file example example_item.json

For more information on data bags, see the Chef docs site:
For more information on data bags, see the Chef Infra docs site:

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

# Encrypted Data Bags

Expand Down Expand Up @@ -51,6 +51,6 @@ Use the secret_key to view the contents.
password: abc123


For more information on encrypted data bags, see the Chef docs site:
For more information on encrypted data bags, see the Chef Infra docs site:

https://docs.chef.io/data_bags.html
https://docs.chef.io/data_bags/
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ For example, in this directory, you'll find an example environment file called `

knife environment from file environments/example.json

For more information on environments, see the Chef docs site:
For more information on environments, see the Chef Infra docs site:

https://docs.chef.io/environments.html
https://docs.chef.io/environments/
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ For example, in this directory, you'll find an example role file called `example

knife role from file roles/example.json

For more information on roles, see the Chef docs site:
For more information on roles, see the Chef Infra docs site:

https://docs.chef.io/roles.html
https://docs.chef.io/roles/
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Policyfile.rb - Describe how you want Chef Infra Client to build your system.
#
# For more information on the Policyfile feature, visit
# https://docs.chef.io/policyfile.html
# https://docs.chef.io/policyfile/

# A name that describes what the system you're building with Chef does.
name '<%= policy_name %>'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Chef Documentation
# https://docs.chef.io/libraries.html
# Chef Infra Documentation
# https://docs.chef.io/libraries/
#

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ provisioner:
always_update_cookbooks: true

## product_name and product_version specifies a specific Chef product and version to install.
## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
# product_name: chef
# product_version: 15
# product_version: 16

verifier:
name: inspec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ provisioner:
name: chef_zero

## product_name and product_version specifies a specific Chef product and version to install.
## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
# product_name: chef
# product_version: 15
# product_version: 16

verifier:
name: inspec
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# To learn more about Custom Resources, see https://docs.chef.io/custom_resources.html
# To learn more about Custom Resources, see https://docs.chef.io/custom_resources/
12 changes: 6 additions & 6 deletions spec/unit/command/generator_commands/cookbook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def with_argv(argv)

it "warns if a hyphenated cookbook name is passed" do
expect(with_argv(%w{my-cookbook}).run).to eq(0)
message = "Hyphens are discouraged in cookbook names as they may cause problems with custom resources. See https://docs.chef.io/ctl_chef.html#chef-generate-cookbook for more information."
message = "Hyphens are discouraged in cookbook names as they may cause problems with custom resources. See https://docs.chef.io/ctl_chef/#chef-generate-cookbook for more information."
expect(stdout_io.string).to include(message)
end

Expand Down Expand Up @@ -523,7 +523,7 @@ def with_argv(argv)
# Policyfile.rb - Describe how you want Chef Infra Client to build your system.
#
# For more information on the Policyfile feature, visit
# https://docs.chef.io/policyfile.html
# https://docs.chef.io/policyfile/

# A name that describes what the system you're building with Chef does.
name 'new_cookbook'
Expand Down Expand Up @@ -571,9 +571,9 @@ def with_argv(argv)
name: chef_zero

## product_name and product_version specifies a specific Chef product and version to install.
## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
# product_name: chef
# product_version: 15
# product_version: 16

verifier:
name: inspec
Expand Down Expand Up @@ -658,9 +658,9 @@ def with_argv(argv)
always_update_cookbooks: true

## product_name and product_version specifies a specific Chef product and version to install.
## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
# product_name: chef
# product_version: 15
# product_version: 16

verifier:
name: inspec
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/command/generator_commands/policyfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def generator_context
# Policyfile.rb - Describe how you want Chef Infra Client to build your system.
#
# For more information on the Policyfile feature, visit
# https://docs.chef.io/policyfile.html
# https://docs.chef.io/policyfile/

# A name that describes what the system you're building with Chef does.
name 'my-app-frontend'
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/command/generator_commands/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ def generator_context

knife role from file roles/example.json

For more information on roles, see the Chef docs site:
For more information on roles, see the Chef Infra docs site:

https://docs.chef.io/roles.html
https://docs.chef.io/roles/
README
end

Expand All @@ -355,9 +355,9 @@ def generator_context

knife environment from file environments/example.json

For more information on environments, see the Chef docs site:
For more information on environments, see the Chef Infra docs site:

https://docs.chef.io/environments.html
https://docs.chef.io/environments/
README
end

Expand Down