You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The chef-repo contains several directories, each with a README file that describes what it is for and how to use that directory when managing systems.
33
+
The chef-repo contains several directories, each with a README file that describes what it's for and how to use that directory when managing systems.
34
34
35
35
The default structure of a new chef-repo is:
36
36
37
-
```output
37
+
```plain
38
38
. chef-repo
39
-
- cookbooks
40
-
- README.md
41
-
- example
42
-
- attribtes
43
-
- default.rb
44
-
- recipes
45
-
- default.rb
46
-
- metadata.rb
47
-
- README.md
48
-
- data_bags
49
-
- example
50
-
- example_item.json
51
-
- README.md
52
-
- policyfiles
53
-
- README.md
54
-
- .chef-repo.txt
55
-
- chefignore
56
-
- License
57
-
- README.md
39
+
├── LICENSE
40
+
├── README.md
41
+
├── chefignore
42
+
├── cookbooks
43
+
│ ├── README.md
44
+
│ └── example
45
+
│ ├── README.md
46
+
│ ├── attributes
47
+
│ │ ├── README.md
48
+
│ │ └── default.rb
49
+
│ ├── metadata.rb
50
+
│ └── recipes
51
+
│ ├── README.md
52
+
│ └── default.rb
53
+
├── data_bags
54
+
│ ├── README.md
55
+
│ └── example
56
+
│ ├── README.md
57
+
│ └── example_item.json
58
+
└── policyfiles
59
+
└── README.md
58
60
```
59
61
60
-
### cookbooks/
61
-
62
-
This directory contains the cookbooks that are used to configure systems in the infrastructure which are are downloaded from the [Chef Supermarket](https://supermarket.chef.io/) or created locally. The Chef Infra Client uses cookbooks to configuring the systems in the organization. Each cookbook can be configured to contain cookbook-specific copyright, email, and license data.
62
+
### cookbooks
63
63
64
-
### data_bags/
64
+
The `cookbooks` directory contains cookbooks that configure systems in the infrastructure which are are downloaded from the [Chef Supermarket](https://supermarket.chef.io/) or created locally. The Chef Infra Client uses cookbooks to configuring the systems in the organization. Each cookbook can be configured to contain cookbook-specific copyright, email, and license data.
65
65
66
-
The `data_bags/` directory is used to store all the data bags that exist for an organization. Each sub-directory corresponds to a single data bag on the Chef Infra Server and contains a JSON file corresponding to each data bag item.
66
+
### data_bags
67
67
68
-
### policyfiles/
68
+
The `data_bags` directory is used to store all the data bags that exist for an organization. Each sub-directory corresponds to a single data bag on the Chef Infra Server and contains a JSON file corresponding to each data bag item.
69
69
70
-
The `policyfiles/` directory is used to store Policyfiles in the `.rb` format that define the set of cookbooks and attributes to apply to specific systems managed by the Chef Infra Server.
70
+
### policyfiles
71
71
72
-
## chefignore Files
72
+
The `policyfiles` directory is used to store Policyfiles in the `.rb` format that define the set of cookbooks and attributes to apply to specific systems managed by the Chef Infra Server.
73
73
74
-
The chefignore file is used to tell knife which cookbook files in the chef-repo should be ignored when uploading data to the Chef Infra Server. The type of data that should be ignored includes swap files, version control data, build output data, and so fort. The chefignore file uses the `File.fnmatch` Ruby syntax to define the ignore patterns using `*`, `**`, and `?` wildcards.
74
+
###chefignore
75
75
76
-
- A pattern is relative to the cookbook root
77
-
- A pattern may contain relative directory names
78
-
- A pattern may match all files in a directory
76
+
A `chefignore` file tells knife which cookbook files in the chef-repo it should ignore when uploading data to the Chef Infra Server.
77
+
Include swap files, version control data, and build output data in a `chefignore` file.
79
78
80
-
The chefignore file can be located in any subdirectory of a chef-repo: `/`, `/cookbooks`, `/cookbooks/COOKBOOK_NAME/`, etc. It should contain sections similar to the following:
81
-
82
-
```none
83
-
## section
84
-
*ignore_pattern
79
+
The `chefignore` file has the following rules:
85
80
86
-
## section
87
-
ignore_pattern*
81
+
- Patterns use `*`, `**`, and `?` wildcards to match files and directories as defined by the `File.fnmatch` Ruby method.
82
+
- A pattern is relative to the directory it's included in.
83
+
- A pattern may contain relative directory names.
84
+
- A pattern may match all files in a directory.
85
+
- You can add a `chefignore` file to any subdirectory of a chef-repo. For example, `/`, `/cookbooks`, `/cookbooks/COOKBOOK_NAME/`, etc.
86
+
- Lines that start with `#` are comments.
88
87
89
-
## section
90
-
**ignore_pattern
88
+
Group types of ignored files in sections similar to the following:
91
89
92
-
## section
93
-
ignore_pattern**
94
-
95
-
## section
96
-
?ignore_pattern
90
+
```plain
91
+
## OS generated files
92
+
*ignore_pattern
97
93
98
-
## section
99
-
ignore_pattern?
94
+
## Editors
95
+
another_ignore_pattern*
100
96
```
101
97
102
-
### Examples
103
-
104
-
The following example shows how to add entries to the `chefignore` file.
98
+
See Ruby's [`File.fnmatch` documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch) for information on creating matching file patterns.
105
99
106
-
#### Ignore editor swap files
100
+
#### Examples
107
101
108
-
Many text editors leave files behind. To prevent these files from being uploaded to the Chef Infra Server, add an entry to the `chefignore` file.
102
+
Many text editors leave files behind. To prevent knife from uploading these files to the Chef Infra Server, add an entry to the `chefignore` file.
0 commit comments