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
Copy file name to clipboardExpand all lines: README.md
+11-17Lines changed: 11 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -127,14 +127,17 @@ file_line { 'bashrc_proxy':
127
127
}
128
128
```
129
129
130
-
In this code example, `match` looks for a line beginning with export followed by HTTP_PROXY and replaces it with the value in line. If a match is not found, then no changes are made to the file.
130
+
In this code example, `match` looks for a line beginning with export followed by 'HTTP_PROXY' and replaces it with the value in line. If a match is not found, then no changes are made to the file.
131
131
132
-
Examples With`ensure => absent`:
132
+
Examples of`ensure => absent`:
133
133
134
134
This type has two behaviors when `ensure => absent` is set.
135
135
136
-
One possibility is to set `match => ...` and `match_for_absence => true`,
137
-
as in the following example:
136
+
The first is to set `match => ...` and `match_for_absence => true`. Match looks for a line beginning with 'export', followed by 'HTTP_PROXY', and then deletes it. If multiple lines match, an error is raised unless the `multiple => true` parameter is set.
137
+
138
+
The `line => ...` parameter in this example would be accepted but ignored.
139
+
140
+
For example:
138
141
139
142
```puppet
140
143
file_line { 'bashrc_proxy':
@@ -145,15 +148,9 @@ file_line { 'bashrc_proxy':
145
148
}
146
149
```
147
150
148
-
In this code example match will look for a line beginning with export
149
-
followed by HTTP_PROXY and delete it. If multiple lines match, an
150
-
error will be raised unless the `multiple => true` parameter is set.
151
+
The second way of using `ensure => absent` is to specify a `line => ...` and no match. When ensuring lines are absent, the default behavior is to remove all lines matching. This behavior can't be disabled.
151
152
152
-
Note that the `line => ...` parameter would be accepted *but ignored* in
153
-
the above example.
154
-
155
-
The second way of using `ensure => absent` is to specify a `line => ...`,
156
-
and no match:
153
+
For example:
157
154
158
155
```puppet
159
156
file_line { 'bashrc_proxy':
@@ -163,9 +160,6 @@ file_line { 'bashrc_proxy':
163
160
}
164
161
```
165
162
166
-
Note that when ensuring lines are absent this way, the default behavior
167
-
this time is to always remove all lines matching, and this behavior
168
-
can't be disabled.
169
163
170
164
Encoding example:
171
165
@@ -236,7 +230,7 @@ Default value: `false`.
236
230
237
231
##### `multiple`
238
232
239
-
Specifies whether `match` and `after` can change multiple lines. If set to `false`, allows file\_line to replace only one line and raises an error if more than one will be replaced. If set to `true`, allows file\_line to replace one or more lines.
233
+
Specifies whether `match` and `after` can change multiple lines. If set to `false`, allows file_line to replace only one line and raises an error if more than one will be replaced. If set to `true`, allows file_line to replace one or more lines.
240
234
241
235
Values: `true`, `false`.
242
236
@@ -271,7 +265,7 @@ Default value: `true`.
271
265
272
266
##### `replace_all_matches_not_matching_line`
273
267
274
-
Replace all lines matched by `match` parameter, even if `line` already exists in the file.
268
+
Replaces all lines matched by `match` parameter, even if `line` already exists in the file.
0 commit comments