fix: usage documentation

This commit is contained in:
U-MIRANTIS\erabinovich 2016-07-06 16:49:08 +03:00
parent 1079f70bc4
commit 037f0e948a

View File

@ -20,22 +20,22 @@ Basic parameters:
* ``-v``, ``--verbose`` verbose(INFO) logging
* ``-d``, ``--debug`` debug(DEBUG) logging
**Shell Mode** - a mode of exectution which does the following changes:
**Shell Mode** - a mode of execution which makes the following changes:
* rqfile (``rq.yaml`` by default) is skipped
* Fuel node is skipped
* outputs of commands (specified with ``-C`` options) and scripts (specified with ``-S``) are printed on screen
* any actions (cmds, scripts, files, filelists, put, **except** logs) and Parameter Based configuration defined in config are ignored.
The following parameters ("actions") are available, using any of them enables **Shell Mode**:
The following parameters ("actions") are available, the usage of any of them enables **Shell Mode**:
* ``-C <command>`` - Bash command (string) to execute on nodes. Using multiple ``-C`` statements will give the same result as using one with several commands separated by ``;`` (traditional Shell syntax), but for each ``-C`` statement a new SSH connection is established
* ``-S <script>`` - name of the Bash script file to execute on nodes (if you do not have a path separator in the filename, you need to put the file into ``scripts`` folder inside a path specified by ``rqdir`` config parameter, defaults to ``rq``. If path separator is present, a given filename will be used directly as provided)
* ``-C <command>`` - Bash command (string) to execute on nodes. Using multiple ``-C`` statements will produce the same result as using one with several commands separated by ``;`` (traditional Shell syntax), but for each ``-C`` statement a new SSH connection is established
* ``-S <script>`` - name of the Bash script file to execute on nodes (if you do not have a path separator in the filename, you need to put the file into ``scripts`` folder inside a path specified by ``rqdir`` config parameter, defaults to ``rq``. If a path separator is present, the given filename will be used directly as provided)
* ``-P <file/path> <dest>`` - upload local data to nodes (wildcards supported). You must specify 2 values for each ``-P`` switch.
* ``-G <file/path>`` - download (collect) data from nodes
========
Examples
Examples
========
* ``timmy`` - run according to the default configuration and default actions. Default actions are defined in ``rq.yaml`` (``/usr/share/timmy/rq.yaml``). Logs are not collected.
@ -44,13 +44,13 @@ Examples
* ``timmy -C 'uptime; free -m'`` - check uptime and memory on all nodes
* ``timmy -G /etc/nova/nova.conf`` - get nova.conf from all nodes
* ``timmy -R controller -P package.deb '' -C 'dpkg -i package.deb' -C 'rm package.deb' -C 'dpkg -l | grep [p]ackage'`` - push a package to all nodes, install it, remove the file and check that it is installed
* ``timmy -с myconf.yaml`` - use a custom config file and run according to it. Custom config can specify any actions, log setup, and other settings. See configuration doc for more details.
* ``timmy -с myconf.yaml`` - use a custom config file and run the program according to it. Custom config can specify any actions, log setup, and other settings. See configuration doc for more details.
===============================
Using custom configuration file
===============================
If you want to do a set of actions on the nodes and you do not want to write a long command line (or you want to use options only available in config), you may want to set up config file instead. An example config structure would be:
If you want to perform a set of actions on the nodes without writing a long command line (or if you want to use the options only available in config), you may want to set up config file instead. An example config structure would be:
::
@ -60,7 +60,7 @@ If you want to do a set of actions on the nodes and you do not want to write a l
roles: # only execute on Fuel and controllers
- fuel
- controller
cmds: # some commands to run on all nodes (after filtering). cmds syntax is {name: value, ...}. cmds are executed in alphabetical order of names.
cmds: # some commands to run on all nodes (after filtering). cmds syntax is {name: value, ...}. cmds are executed in alphabetical order.
01-my-first-command: 'uptime'
02-disk-check: 'df -h'
and-also-ram: 'free -m'
@ -68,7 +68,7 @@ If you want to do a set of actions on the nodes and you do not want to write a l
exclude: '.*' # exclude all logs by default
by_roles:
controller:
scripts: # I use script here to not overwrite cmds we have already defined for all nodes earlier
scripts: # I use script here to not overwrite the cmds we have already defined for all nodes
- pacemaker-debug.sh # the name of the file inside 'scripts' folder inside 'rqdir' path, which will be executed (by default) on all nodes
files:
- '/etc/coros*' # get all files from /etc/coros* wildcard path
@ -78,7 +78,7 @@ If you want to do a set of actions on the nodes and you do not want to write a l
Then you would run ``timmy -l -c my-config.yaml`` to execute timmy with such config.
Instead of setting all structure in a config file you can move actions (cmds, files, filelists, scripts, logs) to an rqfile, and specify ``rqfile`` path in config (although with this example the config-way is more compact). ``rqfile`` structure is a bit different:
Instead of putting all structure in a config file you can move actions (cmds, files, filelists, scripts, logs) to an rqfile, and specify ``rqfile`` path in config (although in this example the config-way is more compact). ``rqfile`` structure is a bit different:
::
@ -88,7 +88,7 @@ Instead of setting all structure in a config file you can move actions (cmds, fi
- 02-disk-check: 'df -h'
- and-also-ram: 'free -m'
scripts:
by_roles: # all non "__default" keys should be matches, "by_<parameter>"
by_roles: # all non "__default" keys should match, "by_<parameter>"
controller:
- pacemaker-debug.sh
files:
@ -102,7 +102,7 @@ Instead of setting all structure in a config file you can move actions (cmds, fi
__default:
exclude: '.*'
Then the config should look like:
Then the config should look like this:
::