Chef cookbooks creating
Creating a cookbooks
[root@chef-workstation chef-repo]# cd /opt/chef/chef-starter/chef-repo/cookbooks
[root@chef-workstation cookbooks]# chef generate cookbook cookbook1
+---------------------------------------------+
Chef License Acceptance
Before you can continue, 1 product license
must be accepted. View the license at
https://www.chef.io/end-user-license-agreement/
License that need accepting:
* Chef Workstation
Do you accept the 1 product license (yes/no)?
> Yes
Persisting 1 product license...
✔ 1 product license persisted.
+---------------------------------------------+
Generating cookbook cookbook1
- Ensuring correct cookbook content
- Committing cookbook files to git
Your cookbook is ready. Type `cd cookbook1` to enter it.
There are several commands you can run to get started locally developing and testing your cookbook.
Why not start by writing an InSpec test? Tests for the default recipe are stored at:
test/integration/default/default_test.rb
If you'd prefer to dive right in, the default recipe can be found at:
recipes/default.rb
[root@chef-workstation cookbooks]# ls -lrt
total 4
-rw-r--r--. 1 root root 588 May 5 20:30 chefignore
drwxr-xr-x. 6 root root 88 May 6 09:21 starter
drwxr-xr-x. 6 root root 210 May 7 11:20 cookbook1
[root@chef-workstation cookbooks]#
Creating cookbook2
[root@chef-workstation cookbooks]# chef generate cookbook cookbook2
Generating cookbook cookbook2
- Ensuring correct cookbook content
- Committing cookbook files to git
Your cookbook is ready. Type `cd cookbook2` to enter it.
There are several commands you can run to get started locally developing and testing your cookbook.
Why not start by writing an InSpec test? Tests for the default recipe are stored at:
test/integration/default/default_test.rb
If you'd prefer to dive right in, the default recipe can be found at:
recipes/default.rb
[root@chef-workstation cookbooks]# ls -lrt
total 4
-rw-r--r--. 1 root root 588 May 5 20:30 chefignore
drwxr-xr-x. 6 root root 88 May 6 09:21 starter
drwxr-xr-x. 6 root root 210 May 7 11:20 cookbook1
drwxr-xr-x. 6 root root 210 May 7 11:21 cookbook2
[root@chef-workstation cookbooks]# t
Comments
Post a Comment