mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
parent
7ea0328fef
commit
94543fe68d
5 changed files with 76 additions and 3 deletions
|
@ -615,7 +615,7 @@
|
|||
##### Range Cluster settings #####
|
||||
##########################################
|
||||
# The range server (and optional port) that serves your cluster information
|
||||
# https://github.com/grierj/range/wiki/Introduction-to-Range-with-YAML-files
|
||||
# https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
|
||||
#
|
||||
#range_server: range:80
|
||||
|
||||
|
|
|
@ -2058,7 +2058,7 @@ Range Cluster Settings
|
|||
Default: ``''``
|
||||
|
||||
The range server (and optional port) that serves your cluster information
|
||||
https://github.com/grierj/range/wiki/Introduction-to-Range-with-YAML-files
|
||||
https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ Support has been added for matching minions with Yahoo's range library. This
|
|||
is handled by passing range syntax with *-R* or *--range* arguments to salt.
|
||||
|
||||
More information at:
|
||||
https://github.com/grierj/range/wiki/Introduction-to-Range-with-YAML-files
|
||||
https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
|
||||
|
||||
|
||||
Requisite "in"
|
||||
|
|
|
@ -32,3 +32,4 @@ There are many ways to target individual minions or groups of minions in Salt:
|
|||
compound
|
||||
nodegroups
|
||||
batch
|
||||
range
|
||||
|
|
72
doc/topics/targeting/range.rst
Normal file
72
doc/topics/targeting/range.rst
Normal file
|
@ -0,0 +1,72 @@
|
|||
.. _targeting_range:
|
||||
|
||||
==========
|
||||
SECO Range
|
||||
==========
|
||||
|
||||
SECO range is a cluster-based metadata store developed and maintained by Yahoo!
|
||||
|
||||
The Range project is hosted here:
|
||||
|
||||
https://github.com/ytoolshed/range
|
||||
|
||||
Learn more about range here:
|
||||
|
||||
https://github.com/ytoolshed/range/wiki/
|
||||
|
||||
Prerequsites
|
||||
============
|
||||
|
||||
To utilize range support in Salt, a range server is required. Setting up a
|
||||
range server is outside the scope of this document. Apache modules are included
|
||||
in the range distribution.
|
||||
|
||||
With a working range server, cluster files must be defined. These files are
|
||||
written in YAML and define hosts contained inside a cluster. Full documentation
|
||||
on writing YAML range files is here:
|
||||
|
||||
https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
|
||||
|
||||
Additionally, the Python seco range libraries must be instaled on the salt
|
||||
master. One can verify that they have been installed correctly via the
|
||||
following command:
|
||||
|
||||
`python -c 'import seco.range'`
|
||||
|
||||
If no errors are returned, range is installed successfully on the salt master.
|
||||
|
||||
Preparing Salt
|
||||
==============
|
||||
|
||||
Range support must be enabled on the salt master by setting the hostname and
|
||||
port of the range server inside the master configuration file:
|
||||
|
||||
range_server: my.range.server.com:80
|
||||
|
||||
Following this, the master must be restarted for the change to have an effect.
|
||||
|
||||
Targeting with Range
|
||||
====================
|
||||
|
||||
Once a cluster has been defined, it can be targeted with a salt command by
|
||||
using the '-R' or '--range' flags.
|
||||
|
||||
For example, given the following range YAML file being served from a range
|
||||
server:
|
||||
|
||||
$ cat /etc/range/test.yaml
|
||||
CLUSTER: host1..100.test.com
|
||||
APPS:
|
||||
- frontend
|
||||
- backend
|
||||
- mysql
|
||||
|
||||
|
||||
One might target host1 through host100 in the test.com domain with Salt as follows:
|
||||
|
||||
salt --range %test:CLUSTER test.ping
|
||||
|
||||
|
||||
The following salt command would target three hosts: 'frontend', 'backend' and 'mysql':
|
||||
|
||||
salt --range %test:APPS test.ping
|
Loading…
Add table
Reference in a new issue