
Applying latest changes for packaging Fixed typos in man pages Latest round of changes More packaging fixups Fixed salt-common typo Fixed wildcarding in install files Removed extra man pages Removed trailing slash Fixed links Moved binaries to proper packages Fixed man pages Pathing Perms tweak Missing files Fixed spacing Fixed another lintian error build the msgpack stuff Updating rules and install files Fixed shebang Control updates Fixed copyright file Fixed lintian Fixed overrides cmd.retcode no longer uses subprocess.call since it is broken fix issue with source_hash and trailing whitespace Bye-bye pickle, hello msgpack Add docs for new source powers Add support for source_hash to be a source hash string add pure python template type add return clarifying that no states were found if no states are found change some strings to use format add code to cache jobs on the minion if option is set serialize cache data was caching the wrong line data Add cache_jobs to the minion config template add docs for new config param cache_jobs make the minions return to the master in addition to returning to returners Add capability to designate multiple returns only run the apache module if apachectl is installed only load solr module if solr is installed Debug statement used the wrong variable. Only load nginx on machines that have nginx installed Make it more like the apache module
7.4 KiB
Configuring the Salt Minion
The Salt system is amazingly simple and easy to configure, the two
components of the Salt system each have a respective configuration file.
The salt-master
is
configured via the master configuration file, and the salt-minion
is configured
via the minion configuration file.
example minion configuration file <configuration-examples-minion>
The Salt Minion configuration is very simple, typically the only value that needs to be set is the master value so the minion can find its master.
Minion Primary Configuration
master
Default: salt
The hostname or ipv4 of the master.
master: salt
master_port
Default: 4506
The port of the master ret server, this needs to coincide with the ret_port option on the salt master.
master_port: 4506
pki_dir
Default: /etc/salt/pki
The directory used to store the minion's public and private keys.
pki_dir: /etc/salt/pki
id
Default: hostname (as returned by the Python call:
socket.getfqdn()
)
Explicitly declare the id for this minion to use, if left commented the id will be the hostname as returned by the python call: socket.getfqdn() Since salt uses detached ids it is possible to run multiple minions on the same machine but with different ids, this can be useful for salt compute clusters.
id: foo.bar.com
sub_timeout
The minion connection to the master may be inturupted, the minion will verify the connection every so many seconds, to disable connection verification set this value to 0
sub_timeout: 60
cachedir
Default: /var/cache/salt
The location for minion cache data.
cachedir: /var/cache/salt
cache_jobs
Default: False
The minion can locally cache the return data from jobs sent to it, this can be a good way to keep track minion side of the jobs the minion has executed. By default this feature is disabled, to enable set cache_jobs to True
cache_jobs: False
acceptance_wait_time
Default: 10
The number of seconds to wait until attempting to re-authenticate with the master.
acceptance_wait_time: 10
Minion Module Management
disable_modules
Default: []
(all modules are enabled by default)
The event may occur in which the administrator desires that a minion should not be able to execute a certain module. The sys module is built into the minion and cannot be disabled.
This setting can also tune the minion, as all modules are loaded into ram disabling modules will lover the minion's ram footprint.
disable_modules:
- test
- solr
disable_returners
Default: []
(all returners are enabled by default)
If certian returners should be disabled, this is the place
disable_returners:
- mongo_return
module_dirs
Default: []
A list of extra directories to search for salt modules
module_dirs:
- /var/lib/salt/modules
returner_dirs
Default: []
A list of extra directories to search for salt returners
returners_dirs:
- /var/lib/salt/returners
states_dirs
Default: []
A list of extra directories to search for salt states
states_dirs:
- /var/lib/salt/states
render_dirs
Default: []
A list of extra directories to search for salt renderers
render_dirs:
- /var/lib/salt/renderers
cython_enable
Default: False
Set this value to true to enable auto loading and compiling of .pyx modules, This setting requires that gcc and cython are installed on the minion
cython_enable: False
State Management Settings
renderer
Default: yaml_jinja
The default renderer used for local state executions
renderer: yaml_jinja
state_verbose
Default: False
state_verbose allows for the data returned from the minion to be more verbose. Normaly only states that fail or states that have changes are returned, but setting state_verbose to True will return all states that were checked
state_verbose: True
autoload_dynamic_modules
Default: True
autoload_dynamic_modules Turns on automatic loading of modules found in the environments on the master. This is turned on by default, to turn of autoloading modules when states run set this value to False
autoload_dynamic_modules: True
Default: True
clean_dynamic_modules keeps the dynamic modules on the minion in sync with the dynamic modules on the master, this means that if a dynamic module is not on the master it will be deleted from the minion. By default this is enabled and can be disabled by changing this value to False
clean_dynamic_modules: True
Security Settings
open_mode
Default: False
Open mode can be used to clean out the pki key received from the salt master, turn on open mode, restart the minion, then turn off open mode and restart the minion to clean the keys.
open_mode: False
Thread Settings
Default: True
Disable multiprocessing support, by default when a minion receives a publication a new process is spawned and the command is executed therein.
multiprocessing: True
Minion Logging Settings
log_file
Default: /var/log/salt/minion
The location of the minion log file
log_file: /var/log/salt/minion
log_level
Default: warning
The level of messages to send to the log file. One of 'info', 'quiet', 'critical', 'error', 'debug', 'warning'.
log_level: warning
log_granular_levels
Default: {}
Logger levels can be used to tweak specific loggers logging levels. Imagine you want to have the salt library at the 'warning' level, but, you still wish to have 'salt.modules' at the 'debug' level:
log_granular_levels:
'salt': 'warning',
'salt.modules': 'debug'