diff options
author | Neil Lathwood <neil@lathwood.co.uk> | 2018-04-27 10:51:39 +0100 |
---|---|---|
committer | Neil Lathwood <neil@lathwood.co.uk> | 2018-04-27 10:51:39 +0100 |
commit | 6574f129bca9633d728c178b12e49a2e9be89cdd (patch) | |
tree | a2d630fca3156658aea07469b9a5c3fdf00f6846 /docs/Outputs.md | |
parent | d96cfac1f09ff4055f54ab604358290865d41f62 (diff) | |
parent | 34fd5369feee94ab45c5a81d7769b1df717e4c8c (diff) |
Rebased from master
Diffstat (limited to 'docs/Outputs.md')
-rw-r--r-- | docs/Outputs.md | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/docs/Outputs.md b/docs/Outputs.md index e3bd42d..fab3bf8 100644 --- a/docs/Outputs.md +++ b/docs/Outputs.md @@ -1,23 +1,22 @@ +# Outputs -## Output - -### Output: File +## Output: File Parent directory needs to be created manually, one file per device, with most recent running config. -``` +```yaml output: file: directory: /var/lib/oxidized/configs ``` -### Output: Git +## Output: Git This uses the rugged/libgit2 interface. So you should remember that normal Git hooks will not be executed. -For a single repositories for all devices: +For a single repository containing all devices: -``` yaml +```yaml output: default: git git: @@ -26,9 +25,9 @@ output: repo: "/var/lib/oxidized/devices.git" ``` -And for groups repositories: +And for group-based repositories: -``` yaml +```yaml output: default: git git: @@ -40,14 +39,14 @@ output: Oxidized will create a repository for each group in the same directory as the `default.git`. For example: -``` csv +```csv host1:ios:first host2:nxos:second ``` This will generate the following repositories: -``` bash +```bash $ ls /var/lib/oxidized/git-repos default.git first.git second.git @@ -55,7 +54,7 @@ default.git first.git second.git If you would like to use groups and a single repository, you can force this with the `single_repo` config. -``` yaml +```yaml output: default: git git: @@ -64,15 +63,14 @@ output: ``` -### Output: Git-Crypt +## Output: Git-Crypt This uses the gem git and system git-crypt interfaces. Have a look at [GIT-Crypt](https://www.agwa.name/projects/git-crypt/) documentation to know how to install it. Additionally to user and email informations, you have to provide the users ID that can be a key ID, a full fingerprint, an email address, or anything else that uniquely identifies a public key to GPG (see "HOW TO SPECIFY A USER ID" in the gpg man page). +For a single repository containing all devices: -For a single repositories for all devices: - -``` yaml +```yaml output: default: gitcrypt gitcrypt: @@ -84,9 +82,9 @@ output: - "<user@example.com>" ``` -And for groups repositories: +And for group-based repositories: -``` yaml +```yaml output: default: gitcrypt gitcrypt: @@ -101,14 +99,14 @@ output: Oxidized will create a repository for each group in the same directory as the `default`. For example: -``` csv +```csv host1:ios:first host2:nxos:second ``` This will generate the following repositories: -``` bash +```bash $ ls /var/lib/oxidized/git-repos default.git first.git second.git @@ -116,7 +114,7 @@ default.git first.git second.git If you would like to use groups and a single repository, you can force this with the `single_repo` config. -``` yaml +```yaml output: default: gitcrypt gitcrypt: @@ -130,11 +128,12 @@ output: Please note that user list is only updated once at creation. -### Output: Http +## Output: Http -POST a config to the specified URL +The HTTP output will POST a config to the specified HTTP URL. Basic username/password authentication is supported. -``` +Example HTTP output configuration: +```yaml output: default: http http: @@ -143,13 +142,13 @@ output: url: "http://192.168.162.50:8080/db/coll" ``` -### Output types +## Output types If you prefer to have different outputs in different files and/or directories, you can easily do this by modifying the corresponding model. To change the behaviour for IOS, you would edit `lib/oxidized/model/ios.rb` (run `gem contents oxidized` to find out the full file path). For example, let's say you want to split out `show version` and `show inventory` into separate files in a directory called `nodiff` which your tools will not send automated diffstats for. You can apply a patch along the lines of -``` +```text - cmd 'show version' do |cfg| - comment cfg.lines.first + cmd 'show version' do |state| @@ -183,8 +182,8 @@ For example, let's say you want to split out `show version` and `show inventory` which will result in the following layout -``` +```text diff/$FQDN--show_running_config nodiff/$FQDN--show_version nodiff/$FQDN--show_inventory -```
\ No newline at end of file +``` |