README.md in knife-topo-0.0.4 vs README.md in knife-topo-0.0.5

- old
+ new

@@ -22,41 +22,41 @@ This plugin has been tested with Chef Version 11.12 on Ubuntu 14.04 LTS. # Usage # -Define one or more topologies in a [topology file](#markdown-header-topology-file). +Define one or more topologies in a [topology file](#topology-file). Import the topology file into your local chef repo using -[knife topo import](#markdown-header-knife-topo-import). Create and optionally +[knife topo import](#import). Create and optionally bootstrap a topology on the Chef server using -[knife topo create](#markdown-header-knife-topo-create), and update it -using [knife topo update](#markdown-header-knife-topo-update). +[knife topo create](#create), and update it +using [knife topo update](#update). # Getting Started # -Try out this plugin using a [test repo](knife-topo/src/master/test-repo) +Try out this plugin using a [test repo](test-repo) which you can download from Github or is included in the installed gem. See the -[Instructions](knife-topo/src/master/test-repo/Instructions.md) for a +[Instructions](Instructions.md) for a demo script, explanation, and troubleshooting. The instructions assume you have [chefDK](http://www.getchef.com/downloads/chef-dk/) or equivalent installed and working with Vagrant and VirtualBox, but none of these are requirements for this plugin. -# Topology File # +# Topology File <a name="topology-file"></a># -See the [example topology file](knife-topo/src/master/test-repo/topology.json) +See the [example topology file](test-repo/topology.json) The topology file contains a single topology, or an array of topologies. Each topology has some overall properties, an array of nodes and an array defining topology cookbook attributes. -## Overall Properties +## Overall Topology Properties <a name="topology-properties"></a> -```json +``` { "name": "test1", "chef_environment": "test", "tags": ["system_sys1", "phase_test" ], "normal": { @@ -67,37 +67,38 @@ "nodes" : [ ... ], "cookbook_attributes" : [ ] - }, + } ``` The `name` is how you will refer to the topology in the `knife topo` subcommands. The `chef-environment` and `normal` attributes defined here will be applied to all nodes in the topology, unless alternative values are provided for a specific node. The `tags` will be added to each node. -## Node List +## Node List <a name="node-list"></a> Each topology contains a list of `nodes`. -```json - "{ +``` + { "name": "test1", - ..., + ... "nodes": { "buildserver": { "name": "buildserver01", "ssh_host": "192.168.1.201", "ssh_port": "2224", "chef_environment": "dev", "run_list": ["role[base-ubuntu]", "ypo::db", "recipe[ypo::appserver]"], "normal": { - "topo.node_type": "buildserver", - "another": "Value 1" + "topo" : { + node_type": "buildserver" + } }, "tags": ["build"] }, ... } @@ -112,18 +113,18 @@ fields are optional. The `ssh_host` and `ssh_port` are optional fields that are used to bootstrap a node. -## Topology Cookbook Attributes +## Topology Cookbook Attributes <a name="cookbook-attributes"></a> Each topology may have attributes that are set via an attribute file in a topology-specific cookbook. Each attribute file is described in an entry in the 'cookbook_attributes' array. -```json +``` "cookbook_attributes": [ { "cookbook": "testsys_test1", "filename": "softwareversion", "normal": @@ -166,31 +167,31 @@ normal['mongodb'][package_version] = "2.6.1" Attributes listed under the `conditional` property will generate an entry in the attribute file such as: -```ruby +``` if (node['topo']['node_type'] == "buildserver") - normal['mongodb'][package_version] = "2.5.1" + normal['mongodb']['package_version'] = "2.5.1" end ``` -# Subcommands # +# Subcommands <a name="subcommands"></a> The main subcommands for `knife topo` are: -* `knife topo import` - Import one or more into your workspace/local repo -* `knife topo create` - Create and optionally bootstrap a topology of nodes -* `knife topo update` - Update a topology of nodes +* [knife topo import](#import) - Import one or more into your workspace/local repo +* [knife topo create](#create) - Create and optionally bootstrap a topology of nodes +* [knife topo update](#update) - Update a topology of nodes The additional subcommands can also be useful, depending on your workflow: -* `knife topo bootstrap` - Bootstraps a topology of nodes -* `knife topo cookbook create` - Generate the topology cookbooks -* `knife topo cookbook upload` - Upload the topology cookbooks -* `knife export` - Export data from a topology (or from nodes that you want in a topology) +* [knife topo bootstrap](#bootstrap)- Bootstraps a topology of nodes +* [knife topo cookbook create](#cookbook-create) - Generate the topology cookbooks +* [knife topo cookbook upload](#cookbook-upload) - Upload the topology cookbooks +* [knife export](#export) - Export data from a topology (or from nodes that you want in a topology) The topologies are data bag items in the 'topologies' data bag, so you can also use knife commands such as: * `knife data bag show topologies` - List the topologies @@ -203,11 +204,11 @@ Option | Description ------------ | ----------- -D, --data-bag DATA_BAG | The data bag to use for the topologies. Defaults to 'topologies'. -## knife topo bootstrap +## knife topo bootstrap <a name="bootstrap"></a> knife topo bootstrap TOPOLOGY Runs the `knife bootstrap` command for each node in the topology that has the `ssh_host` attribute. Specified options will be passed through @@ -226,32 +227,32 @@ The following will bootstrap nodes in the test1 topology, using a user name of vagrant, password of vagrant, and running using sudo. $ knife topo bootstrap sys1_test test1 -x vagrant -P vagrant --sudo -## knife topo cookbook create +## knife topo cookbook create <a name="cookbook-create"></a> knife topo cookbook create TOPOLOGY Generates the topology cookbook attribute files and attributes described in the -'cookbook_attributes' property. +[cookbook_attributes](#cookbook-attributes) property. ### Options: The knife topo cookbook create subcommand supports the following additional options. Option | Description ------------ | ----------- -See [knife cookbook create](http://docs.opscode.com/chef/knife.html#cookbook) | +See [knife cookbook create](http://docs.opscode.com/chef/knife.html#cookbook) | Options supported by `knife cookbook create` are passed through ### Examples: The following will generate the topology cookbook attribute files for topology test1. $ knife topo cookbook create test1 -## knife topo cookbook upload +## knife topo cookbook upload <a name="cookbook-upload"></a> knife topo cookbook upload TOPOLOGY Uploads the topology cookbook attribute files. @@ -259,21 +260,21 @@ The knife topo cookbook upload subcommand supports the following additional options. Option | Description ------------ | ----------- -See [knife cookbook upload](http://docs.opscode.com/chef/knife.html#cookbook) | +See [knife cookbook upload](http://docs.opscode.com/chef/knife.html#cookbook) | Options supported by `knife cookbook upload` are passed through ### Examples: The following will generate the topology cookbook attribute files for topology test1. $ knife topo cookbook create test1 -## knife topo create +## knife topo create <a name="create"></a> knife topo create TOPOLOGY Creates the specified topology in the chef server as an item in the system environment data bag. Creates the chef environment associated @@ -286,11 +287,11 @@ The knife topo create subcommand supports the following additional options. Option | Description ------------ | ----------- ---bootstrap | Bootstrap the topology (see [topo bootstrap](#markdown-header-knife-topo-bootstrap)) +--bootstrap | Bootstrap the topology (see [topo bootstrap](#bootstrap)) See [knife bootstrap](http://docs.opscode.com/knife_bootstrap.html) | Options supported by `knife bootstrap` are passed through to the bootstrap command --no-upload | Do not upload topology cookbooks ### Examples: The following will create the 'test1' topology, and bootstrap it. @@ -300,23 +301,22 @@ The following will create the 'test1' topology but will not bootstrap it or upload topology cookbooks. $ knife topo create test1 --no-upload -## knife topo export +## knife topo export <a name="export"></a> knife topo export [ TOPOLOGY [ NODE ... ] Exports the specified topology as JSON. If the topology does not already exist, an outline for a new topology will be exported. The exported JSON can be used as the basis for a new topology definition. -If nodes are specified, these will be added into the export in addition +If nodes are specified, these will be exported in addition to any nodes that are in the topology. -If no topology is specified, all existing topologies in that environment -will be exported. +If no topology is specified, all defined topologies will be exported. ### Examples: The following will export all topologies to a file called 'sys1_test.json'. $ knife topo export sys1_test > sys1_test.json @@ -324,11 +324,11 @@ The following will create an outline for a new topology called 'christine_test': $ knife topo export christine_test > christine_test.json -## knife topo import +## knife topo import <a name="import"></a> knife topo import [ TOPOLOGY_FILE [ TOPOLOGY ... ]] Imports the system environment and topologies from a [topology file](#Topology File) into the local repo. If no topology @@ -344,10 +344,10 @@ The following will import the 'test1' topology defined in the 'topology.json' file. $ knife topo import topology.json test1 -## knife topo update +## knife topo update <a name="update"></a> knife topo update [ TOPOLOGY ] Updates the specified topology. Creates or updates nodes identified in the topology, using information specified in the