File: advanced-override-enc.md

package info (click to toggle)
octocatalog-diff 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 1,356 kB
  • sloc: ruby: 6,097; sh: 16; makefile: 13
file content (54 lines) | stat: -rw-r--r-- 1,917 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Overriding ENC parameters

One powerful feature of `octocatalog-diff` allows you to override ENC parameters when compiling the catalogs, to predict the effect of an ENC parameter change on the catalog. This is useful to simulate a change in agent node configuration without actually setting up an agent to do so.

## Usage

To override an ENC parameter in both catalogs:

```
--enc-override parameters::some_class::some_param=value
```

To override an ENC parameter in the "to" catalog:

```
--to-enc-override parameters::some_class::some_param=value
```

To override an ENC parameter in the "from" catalog:

```
--from-enc-override parameters::some_class::some_param=value
```

You may use as many of these arguments as you wish to adjust as many ENC parameters as you wish.

## Limitations

As presently implemented, this only works on ENCs that supply their results as YAML.

Is your ENC doing something different? Please [let us know](https://github.com/github/octocatalog-diff/issues/new) so we can enhance octocatalog-diff to handle it!

## Examples

Simulate a change to a top-level parameter named "role" only in the "to" catalog:

```
octocatalog-diff -n some-node.example.com -f master -t master \
  --to-enc-override parameters::role=some_new_role
```

Simulate a change in a class parameter between the catalogs:

```
octocatalog-diff -n some-node.example.com -f master -t master \
  --from-enc-override parameters::my_class::my_value=value_in_old \
  --to-enc-override parameters::my_class::my_value=value_in_new
```

Note that each of the examples specified the from branch and to branch to be `master`. There is no requirement that you do this, but you can generally obtain the most accurate test results by changing only one variable at a time.

## Advanced usage

The format for declaring overrides with data types is the same as [overriding facts](/doc/advanced-override-facts.md#advanced-usage).