README.md in motoko-1.0.0 vs README.md in motoko-1.1.0
- old
+ new
@@ -1,23 +1,53 @@
# Motoko
A gem to get inventories of nodes in a Puppet / Choria deployment.
+<!-- vim-markdown-toc GFM -->
+
+* [Installation](#installation)
+* [Usage](#usage)
+ * [Basic usage](#basic-usage)
+ * [Which nodes are currently up and running](#which-nodes-are-currently-up-and-running)
+ * [Which nodes are known to puppet](#which-nodes-are-known-to-puppet)
+ * [Accessing facts](#accessing-facts)
+ * [Add more facts to the output](#add-more-facts-to-the-output)
+ * [Filtering](#filtering)
+ * [Which nodes have burned in Strasbourg](#which-nodes-have-burned-in-strasbourg)
+* [Configuration](#configuration)
+ * [Columns](#columns)
+ * [Column Specifications](#column-specifications)
+ * [Shortcuts](#shortcuts)
+* [Resolvers](#resolvers)
+ * [Extending Motoko with custom resolvers](#extending-motoko-with-custom-resolvers)
+* [Formatters](#formatters)
+ * [Extending Motoko with custom formatters](#extending-motoko-with-custom-formatters)
+* [Development](#development)
+* [Contributing](#contributing)
+* [License](#license)
+* [Code of Conduct](#code-of-conduct)
+
+<!-- vim-markdown-toc -->
+
## Installation
-Take care to install this tool in the Puppet envrionment. If you are using the AIO package, you can install with:
+Take care to install this tool in the Puppet environment. If you are using the AIO package, you can install with:
```
-/opt/puppetlabs/puppet/bin/gem install --bindir /opt/puppetlabs/bin puppetdb_cli
+/opt/puppetlabs/puppet/bin/gem install --bindir /opt/puppetlabs/bin motoko
```
Alternatively, you can install using Puppet:
```puppet
package { 'motoko':
- ensure => installed,
- provider => 'puppet_gem',
+ ensure => 'installed',
+ provider => 'puppet_gem',
+ install_options => [
+ '--bindir',
+ '/opt/puppetlabs/bin',
+ ],
}
```
## Usage
@@ -56,11 +86,11 @@
The usual filtering knobs are available for the choria inventory script. The puppetdb inventory script has a minimal support for choria-like filtering.
#### Which nodes have burned in Strasbourg
-The initial work on querying PuppetDB is due to the fact that you can't ask Choria for information about nodes which are gone. On March 9th 2021, [OVH lost (part of) it's Strasboug datacenter](https://twitter.com/olesovhcom/status/1369478732247932929?ref_src=twsrc%5Etfw) and the frustration of not being able to conviniently build a list of affected nodes and customers was a pain. with motoko we can now just query PuppetDB:
+The initial work on querying PuppetDB is due to the fact that you can't ask Choria for information about nodes which are gone. On March 9th 2021, [OVH lost (part of) it's Strasboug datacenter](https://twitter.com/olesovhcom/status/1369478732247932929?ref_src=twsrc%5Etfw) and the frustration of not being able to conveniently build a list of affected nodes and customers was a pain. With Motoko we can now just query PuppetDB:
```sh-session
romain@zappy ~ % pdb-inventory -F datacenter=/sbg/
```
## Configuration
@@ -121,37 +151,47 @@
- "virtual=physical"
```
This add a new command switch `--dc` equivalent to `--add-columns datacenter,server_rack,server_id --with-fact virtual=physical`.
+The following settings are available when defining shortcuts:
+
+| Setting | Description |
+|---------------|-------------|
+| `description` | Description of the shortcut (visible in `--help`) |
+| `columns` | List of columns to display |
+| `add_columns` | Extra columns to append of the default list |
+| `with_fact` | Extra filtering of the results based on facts |
+| `with_class` | Extra filtering of the results based on configured classes |
+
## Resolvers
-| Resolver name | Desciption |
-|-------------------|------------|
+| Resolver name | Description |
+|-------------------|-------------|
| `cpu` | Aggregate information about the CPU |
| `fact` | Gather the value of the fact `fact` (default to the column name if unset) |
| `identity` | Gather the node identity |
| `os` | Aggregate information about the OS |
| `reboot_required` | Combine value of various facts to determine if a reboot is required |
### Extending Motoko with custom resolvers
-Custom resolvers can be droped in the `<motoko-config-directory>/resolvers/` directory. They are automatically loaded on startup.
+Custom resolvers can be dropped in the `<motoko-config-directory>/resolvers/` directory. They are automatically loaded on startup.
## Formatters
-| Formatter name | Desciption |
-|-----------------|------------|
+| Formatter name | Description |
+|-----------------|-------------|
| `boolean` | Display a checkmark for things that evaluate to `true` |
| `datetime` | Display a date and time in the local time zone |
| `datetime_ago` | Display a date and time as a duration |
| `ellipsis` | Display a value truncated at `max_length` chars (default: 20) |
| `timestamp` | Display a timestamp (number of seconds since the Unix epoch) in the local time zone |
| `timestamp_ago` | Display a timestamp (number of seconds since the Unix epoch) as a duration |
### Extending Motoko with custom formatters
-Custom formatters can be droped in the `<motoko-config-directory>/formatters/` directory. They are automatically loaded on startup.
+Custom formatters can be dropped in the `<motoko-config-directory>/formatters/` directory. They are automatically loaded on startup.
## Development
In order to use the Puppet environment, use the version of bundler bundled with Puppet: