|
| 1 | +# Configuration |
| 2 | + |
| 3 | +Configuration can be done by config yaml file environment variable (without predefined queries/views) |
| 4 | + |
| 5 | +Default it will look for a config.yaml in the current directory, |
| 6 | +but you can pass the -config parameter to define the location of the config file |
| 7 | + |
| 8 | +## Options |
| 9 | +| Option | Environment Variable | Default | Type | Description | |
| 10 | +|---------------------|----------------------|-----------|--------|--------------------------------------| |
| 11 | +| listen | LISTEN | localhost | string | Listen host/ip | |
| 12 | +| port | PORT | 5000 | int | Listen to port | |
| 13 | +| puppetdb.host | PUPPETDB_HOST | localhost | string | Address of puppetdb | |
| 14 | +| puppetdb.port | PUPPETDB_PORT | 8080 | int | Port of puppetdb | |
| 15 | +| puppetdb.tls | PUPPETDB_TLS | false | bool | Communicate over tls with puppetdb | |
| 16 | +| puppetdb.tls_ignore | PUPPETDB_TLS_IGNORE | false | bool | Ignore validation of tls certificate | |
| 17 | +| puppetdb.tls_ca | PUPPETDB_TLS_CA | | string | Path to ca cert file for puppetdb | |
| 18 | +| puppetdb.tls_key | PUPPETDB_TLS_KEY | | string | Path to key file for puppetdb | |
| 19 | +| puppetdb.tls_crt | PUPPETDB_TLS_CERT | | string | Path to puppetdb tls crt file | |
| 20 | +| queries | | | array | predefined queries (see query table) | |
| 21 | +| views | | | array | predefined views (see view table) | |
| 22 | + |
| 23 | +### predefined Queries |
| 24 | +| Option | Type | Description | |
| 25 | +|-------------|--------|---------------------------| |
| 26 | +| description | string | description of your query | |
| 27 | +| query | string | PQL query string | |
| 28 | +| | | | |
| 29 | + |
| 30 | +### predefined Views |
| 31 | +| Option | Type | Description | |
| 32 | +|--------|--------|---------------------------------------------------| |
| 33 | +| name | string | description of your query | |
| 34 | +| facts | array | facts that should be shown (see view facts table) | |
| 35 | + |
| 36 | + |
| 37 | +### predefined Views - Facts |
| 38 | +| Option | Type | Description | |
| 39 | +|----------|--------|-------------------------------------------------------------------------------------| |
| 40 | +| name | string | column name that should be shown | |
| 41 | +| fact | string | which fact should be shown (can be . seperated for lower level (like networking.ip) | |
| 42 | +| renderer | string | (optional) there are some renderer like hostname or os_name | |
| 43 | + |
| 44 | +## YAML Example |
| 45 | + |
| 46 | +```yaml |
| 47 | +--- |
| 48 | +listen: 127.0.0.1 |
| 49 | +port: 5000 |
| 50 | + |
| 51 | +puppetdb: |
| 52 | + host: localhost |
| 53 | + port: 8081 |
| 54 | + tls: true |
| 55 | + tls_ignore: false |
| 56 | + tls_ca: /path/to/ca.crt |
| 57 | + tls_key: /path/to/cert.key |
| 58 | + tls_cert: /path/to/cert.crt |
| 59 | + |
| 60 | +queries: |
| 61 | + - description: Inactive Nodes |
| 62 | + query: nodes[certname] { node_state = "inactive" } |
| 63 | + |
| 64 | +views: |
| 65 | + - name: 'Inventory' |
| 66 | + facts: |
| 67 | + - name: 'Hostname' |
| 68 | + fact: 'trusted' |
| 69 | + renderer: 'hostname' |
| 70 | + - name: 'IP Address' |
| 71 | + fact: 'networking.ip' |
| 72 | + - name: 'OS' |
| 73 | + fact: 'os' |
| 74 | + renderer: 'os_name' |
| 75 | + - name: 'Kernel Version' |
| 76 | + fact: 'kernelrelease' |
| 77 | + - name: 'Puppet Version' |
| 78 | + fact: 'puppetversion' |
| 79 | +``` |
0 commit comments