Skip to content

Commit 87123fb

Browse files
committed
Add documentation for override regexp facts
1 parent 679ad68 commit 87123fb

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

doc/advanced-override-facts.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,16 @@ The following data types in parentheses are supported:
6565
| `(json)` | Treat the input as a JSON string (calls `JSON.parse` in ruby) |
6666
| `(boolean)` | Treat the input as a boolean -- it must be `true` or `false`, case-insensitive |
6767
| `(nil)` | Ignore any characters after `(nil)` and deletes the fact if the fact exists |
68+
69+
## Regular expressions
70+
71+
If you wish to match multiple facts by pattern, specify the regular expression in place of the key name. For example:
72+
73+
```
74+
octocatalog-diff -n some-node.example.com -f master -t master \
75+
--to-fact-override /^ipaddress/=10.11.12.13
76+
```
77+
78+
In this example, `$::ipaddress`, `$::ipaddress_eth0`, `$::ipaddress_bond0`, and any other facts starting with "ipaddress" would be overridden. However, a fact named `$::additional_ipaddress` would not be overridden, because it does not match the regular expression.
79+
80+
Please note that you cannot *add* a fact with a regular expression -- when using regular expressions you can only modify or delete facts.

0 commit comments

Comments
 (0)