Skip to content

Commit

Permalink
Fix Markdown (#3500)
Browse files Browse the repository at this point in the history
* Fix Markdown

Signed-off-by: kagarmoe <[email protected]>

* MD034 No Bare URLs

Signed-off-by: kagarmoe <[email protected]>

* MD036/no-emphasis-as-heading

Signed-off-by: kagarmoe <[email protected]>

* more MD036

Signed-off-by: kagarmoe <[email protected]>

* Close to done

Signed-off-by: kagarmoe <[email protected]>

* Really almost done

Signed-off-by: kagarmoe <[email protected]>

* Last non-generated MDL

Signed-off-by: kagarmoe <[email protected]>

* MDO13

Signed-off-by: kagarmoe <[email protected]>

* Disable MDL examples

Signed-off-by: kagarmoe <[email protected]>

* MD013 config

Signed-off-by: kagarmoe <[email protected]>

* line-length 999

Signed-off-by: kagarmoe <[email protected]>

* last few

Signed-off-by: kagarmoe <[email protected]>

* Probably done

Signed-off-by: kagarmoe <[email protected]>
  • Loading branch information
Kimberly Garmoe authored Oct 22, 2021
1 parent 0c45567 commit 878bedd
Show file tree
Hide file tree
Showing 93 changed files with 2,013 additions and 3,305 deletions.
8 changes: 6 additions & 2 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extends: null
# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time
MD001: true

# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading
# MD002/first-heading-h2/first-header-h2 - First written heading should be a second level heading
MD002:
# Heading level
level: 2
Expand Down Expand Up @@ -60,7 +60,11 @@ MD012:
maximum: 1

# MD013/line-length - Line length
MD013: false
MD013:
line_length: 999
code_blocks: false
tables: false
headings: true

# MD014/commands-show-output - Dollar signs used before commands without showing output
MD014: true
Expand Down
3 changes: 2 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Please refer to the Chef Community Code of Conduct at https://www.chef.io/code-of-conduct/
<!-- markdownlint-disable-file -->
Please refer to the Chef [Community Code of Conduct](https://www.chef.io/code-of-conduct/)
159 changes: 57 additions & 102 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions archetypes/all_the_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ toc_layout = "infra_resources_all_toc"
<!-- NOTE: The Markdown in this page comes from the archetype file archetypes/all_the_resources.md. If you update the Markdown in this page,
you must also update the Markdown in the archetype page as well, otherwise your changes in this page may be overwritten. -->

<!-- markdownlint-disable-file -->

This reference describes each of the resources available to Chef Infra Client, including a list of actions, properties, and usage examples.

## Common Functionality
Expand Down
4 changes: 2 additions & 2 deletions archetypes/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ toc_layout = "infra_resource_toc"
+++

<!-- The contents of this page are automatically generated from the {{ .Name}}.yaml file in the data directory. -->
<!-- To suggest a change, edit the https://github.com/chef/chef/blob/main/lib/chef/resource/{{ .Name }}.rb file
and submit a pull request to the https://github.com/chef/chef repository. -->
<!-- To suggest a change, edit the https://github.com/chef/chef/blob/main/lib/chef/resource/{{ .Name }}.rb file and submit a pull request to the https://github.com/chef/chef repository. -->
<!-- markdownlint-disable-file -->
2 changes: 1 addition & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ toc = false

[cascade]
product = ["client"]
+++
+++
4 changes: 2 additions & 2 deletions content/api_omnitruck.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Omnitruck accepts the following platforms:

### Examples

**Get the Latest Build**
#### Get the Latest Build

To get the latest supported build for Ubuntu 20.04, enter the following:

Expand All @@ -161,7 +161,7 @@ url https://packages.chef.io/files/stable/chef/16.10.17/ubuntu/20.04/chef_16.10.
version 16.10.17
```

**Download Directly**
#### Download Directly

To use cURL to download a package directly, enter the following:

Expand Down
129 changes: 58 additions & 71 deletions content/attribute_arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ gh_repo = "chef-web-docs"
parent = "chef_infra/cookbook_reference/attributes"
+++

Attributes are typically defined in cookbooks, recipes, roles, and
environments. These attributes are rolled-up to the node level during a
Chef Infra Client run. A recipe can store attribute values using a
multi-level hash or array.
Attributes are typically defined in cookbooks, recipes, roles, and environments. These attributes are rolled-up to the node level during a Chef Infra Client run. A recipe can store attribute values using a multi-level hash or array.

For example, a group of attributes for web servers might be:

Expand All @@ -32,10 +29,7 @@ override_attributes(
)
```

But what if all of the web servers are not the same? What if some of the
web servers required a single attribute to have a different value? You
could store these settings in two locations, once just like the
preceding example and once just like the following:
But what if all of the web servers are not the same? What if some of the web servers required a single attribute to have a different value? You could store these settings in two locations, once just like the preceding example and once just like the following:

```ruby
override_attributes(
Expand All @@ -50,13 +44,7 @@ override_attributes(
)
```

But that is not very efficient, especially because most of them are
identical. The deep merge capabilities of Chef Infra Client allows
attributes to be layered across cookbooks, recipes, roles, and
environments. This allows an attribute to be reused across nodes, making
use of default attributes set at the cookbook level, but also providing
a way for certain attributes (with a higher attribute precedence) to be
applied only when they are supposed to be.
But that is not very efficient, especially because most of them are identical. The deep merge capabilities of Chef Infra Client allows attributes to be layered across cookbooks, recipes, roles, and environments. This allows an attribute to be reused across nodes, making use of default attributes set at the cookbook level, but also providing a way for certain attributes (with a higher attribute precedence) to be applied only when they are supposed to be.

For example, a role named `baseline.rb`:

Expand Down Expand Up @@ -93,19 +81,9 @@ override_attributes(
)
```

Both of these files are similar because they share the same structure.
When an attribute value is a hash, that data is merged. When an
attribute value is an array, if the attribute precedence levels are the
same, then that data is merged. If the attribute value precedence levels
in an array are different, then that data is replaced. For all other
value types (such as strings, integers, etc.), that data is replaced.
Both of these files are similar because they share the same structure. When an attribute value is a hash, that data is merged. When an attribute value is an array, if the attribute precedence levels are the same, then that data is merged. If the attribute value precedence levels in an array are different, then that data is replaced. For all other value types (such as strings, integers, etc.), that data is replaced.

For example, the `web.rb` references the `baseline.rb` role. The
`web.rb` file only provides a value for one attribute: `:startservers`.
When Chef Infra Client compares these attributes, the deep merge feature
will ensure that `:startservers` (and its value of `30`) will be applied
to any node for which the `web.rb` attribute structure should be
applied.
For example, the `web.rb` references the `baseline.rb` role. The `web.rb` file only provides a value for one attribute: `:startservers`. When Chef Infra Client compares these attributes, the deep merge feature will ensure that `:startservers` (and its value of `30`) will be applied to any node for which the `web.rb` attribute structure should be applied.

This approach will allow a recipe like this:

Expand Down Expand Up @@ -137,76 +115,85 @@ to produce results like this:
}
```

Even though the `web.rb` file does not contain attributes and values for
`minspareservers`, `maxspareservers`, `serverlimit`, `maxclients`, and
`maxrequestsperchild`, the deep merge capabilities pulled them in.
Even though the `web.rb` file does not contain attributes and values for `minspareservers`, `maxspareservers`, `serverlimit`, `maxclients`, and `maxrequestsperchild`, the deep merge capabilities pulled them in.

## Attribute Array Logic

The following sections show how the logic works for using deep merge to
perform substitutions and additions of attributes.
The following sections show how the logic works for using deep merge to perform substitutions and additions of attributes.

### Substitution

The following examples show how the logic works for substituting an
existing string using a hash:
The following examples show how the logic works for substituting an existing string using a hash:

role_or_environment 1 { :x => '1', :y => '2' }
+
role_or_environment 2 { :y => '3' }
=
{ :x => '1', :y => '3' }
```text
role_or_environment 1 { :x => '1', :y => '2' }
+
role_or_environment 2 { :y => '3' }
=
{ :x => '1', :y => '3' }
```

For substituting an existing boolean using a hash:

role_or_environment 1 { :x => true, :y => false }
+
role_or_environment 2 { :y => true }
=
{ :x => true, :y => true }
```text
role_or_environment 1 { :x => true, :y => false }
+
role_or_environment 2 { :y => true }
=
{ :x => true, :y => true }
```

For substituting an array with a hash:

role_or_environment 1 [ '1', '2', '3' ]
+
role_or_environment 2 { :x => '1' , :y => '2' }
=
{ :x => '1', :y => '2' }
```text
role_or_environment 1 [ '1', '2', '3' ]
+
role_or_environment 2 { :x => '1' , :y => '2' }
=
{ :x => '1', :y => '2' }
```

When items cannot be merged through substitution, the original data is
overwritten.
When items cannot be merged through substitution, the original data is overwritten.

### Addition

The following examples show how the logic works for adding a string
using a hash:

role_or_environment 1 { :x => '1', :y => '2' }
+
role_or_environment 2 { :z => '3' }
=
{ :x => '1', :y => '2', :z => '3' }
```text
role_or_environment 1 { :x => '1', :y => '2' }
+
role_or_environment 2 { :z => '3' }
=
{ :x => '1', :y => '2', :z => '3' }
```

For adding a string using an array:

role_or_environment 1 [ '1', '2' ]
+
role_or_environment 2 [ '3' ]
=
[ '1', '2', '3' ]
```text
role_or_environment 1 [ '1', '2' ]
+
role_or_environment 2 [ '3' ]
=
[ '1', '2', '3' ]
```

For adding a string using a multi-level hash:

role_or_environment 1 { :x => { :y => '2' } }
+
role_or_environment 2 { :x => { :z => '3' } }
=
{ :x => { :y => '2', :z => '3' } }
```text
role_or_environment 1 { :x => { :y => '2' } }
+
role_or_environment 2 { :x => { :z => '3' } }
=
{ :x => { :y => '2', :z => '3' } }
```

For adding a string using a multi-level array:

role_or_environment 1 [ [ 1, 2 ] ]
+
role_or_environment 2 [ [ 3 ] ]
=
[ [ 1, 2 ], [ 3 ] ]
```text
role_or_environment 1 [ [ 1, 2 ] ]
+
role_or_environment 2 [ [ 3 ] ]
=
[ [ 1, 2 ], [ 3 ] ]
```
2 changes: 1 addition & 1 deletion content/attribute_precedence.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gh_repo = "chef-web-docs"
identifier = "chef_infra/cookbook_reference/attributes/attribute_precedence"
parent = "chef_infra/cookbook_reference/attributes"
+++

<!-- markdownlint-disable-file MD036 -->
{{% node_attribute_precedence %}}

## Examples
Expand Down
1 change: 1 addition & 0 deletions content/attribute_sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ draft = false
identifier = "chef_infra/cookbook_reference/attributes/attribute_sources Attributes"
parent = "chef_infra/cookbook_reference/attributes"
+++
<!-- markdownlint-disable-file MD036 -->

Chef Infra Client evaluates attributes in the order that they are defined in the
run-list, including any attributes that are in the run-list as
Expand Down
Loading

0 comments on commit 878bedd

Please sign in to comment.