设为首页 收藏本站
查看: 1317|回复: 0

[经验分享] saltstack官方文档——Configuring the Salt Minion

[复制链接]

尚未签到

发表于 2015-11-26 10:53:59 | 显示全部楼层 |阅读模式
  转自:http://docs.saltstack.com/ref/configuration/minion.html
  

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.

See also
example minion configuration file
  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



USER
  Default: root
  The user to run the Salt processes

user: root



PIDFILE
  Default: /var/run/salt-minion.pid
  The location of the daemon's process ID file

pidfie: /var/run/salt-minion.pid



ROOT_DIR
  Default: /
  This directory is prepended to the following options: pki_dir, cachedir, log_file, sock_dir,
and pidfile.

root_dir: /



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



APPEND_DOMAIN
  Default: None
  Append a domain to a hostname in the event that it does not exist. This is useful for systems wheresocket.getfqdn() does not actually result in a FQDN (for instance, Solaris).

append_domain: foo.org



CACHEDIR
  Default: /var/cache/salt
  The location for minion cache data.

cachedir: /var/cache/salt



VERIFY_ENV
  Default: True
  Verify and set permissions on configuration directories at startup.

verify_env: True



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 of the minion side of the jobs the minion has executed. By default this feature is disabled, to enable set cache_jobs toTrue.

cache_jobs: False



SOCK_DIR
  Default: /var/run/salt/minion
  The directory where Unix sockets will be kept.

sock_dir: /var/run/salt/minion



BACKUP_MODE
  Default: []
  Backup files replaced by file.managed and file.recurse under cachedir.

backup_mode: minion



ACCEPTANCE_WAIT_TIME
  Default: 10
  The number of seconds to wait until attempting to re-authenticate with the master.

acceptance_wait_time: 10



DNS_CHECK
  Default: True
  When healing, a dns_check is run. This is to make sure that the originally resolved dns has not changed. If this is something that does not happen in your environment, set this value to False.

dns_check: True



IPC_MODE
  Default: ipc
  Windows platforms lack POSIX IPC and must rely on slower TCP based inter- process communications. Set ipc_mode to tcp on such systems.

ipc_mode: ipc



TCP_PUB_PORT
  Default: 4510
  Publish port used when ipc_mode is set to tcp.

tcp_pub_port: 4510



TCP_PULL_PORT
  Default: 4511
  Pull port used when ipc_mode is set to tcp.

tcp_pull_port: 4511


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 certain 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 andcython are
installed on the minion

cython_enable: False



PROVIDERS
  Default: (empty)
  A module provider can be statically overwritten or extended for the minion via the providers option. This can be done on
an individual basis in an SLS file, or globally here in the minion config, like below.

providers:
pkg: yumpkg5
service: systemd


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. Normally 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



STATE_OUTPUT
  Default: full
  The state_output setting changes if the output is the full multi line output for each changed state if set to 'full', but if set to 'terse' the output will be shortened to a single line.

state_output: full



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 auto-loading 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



ENVIRONMENT
  Default: None
  Normally the minion is not isolated to any single environment on the master when running states, but the environment can be isolated on the minion side by statically setting it. Remember that the recommended way to manage environments is to isolate
via the top file.

environment: None


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 minion log can be sent to a regular file, local path name, or network location. Remote logging works best when configured to use rsyslogd(8) (e.g.: file:///dev/log),
with rsyslogd(8) configured for network logging. The format for remote addresses is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>. Examples:

log_file: /var/log/salt/minion


log_file: file:///dev/log


log_file: udp://loghost:10514



LOG_LEVEL
  Default: warning
  The level of messages to send to the console. One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.

log_level: warning



LOG_LEVEL_LOGFILE
  Default: warning
  The level of messages to send to the log file. One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.

log_level_logfile: warning



LOG_DATEFMT
  Default: %H:%M:%S
  The date and time format used in console log messages. Allowed date/time formatting can be seen onhttp://docs.python.org/library/time.html#time.strftime

log_datefmt: '%H:%M:%S'



LOG_DATEFMT_LOGFILE
  Default: %Y-%m-%d %H:%M:%S
  The date and time format used in log file messages. Allowed date/time formatting can be seen onhttp://docs.python.org/library/time.html#time.strftime

log_datefmt_logfile: '%Y-%m-%d %H:%M:%S'



LOG_FMT_CONSOLE
  Default: [%(levelname)-8s] %(message)s
  The format of the console logging messages. Allowed formatting options can be seen onhttp://docs.python.org/library/logging.html#logrecord-attributes

log_fmt_console: '[%(levelname)-8s] %(message)s'



LOG_FMT_LOGFILE
  Default: %(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s
  The format of the log file logging messages. Allowed formatting options can be seen onhttp://docs.python.org/library/logging.html#logrecord-attributes

log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'



LOG_GRANULAR_LEVELS
  Default: {}
  This can be used to control logging levels more specifically. This example sets the main salt library at the 'warning' level, but sets 'salt.modules' to log at the 'debug' level:

log_granular_levels:
'salt': 'warning',
'salt.modules': 'debug'

DEFAULT_INCLUDE
  Default: minion.d/*.conf
  The minion can include configuration from other files. Per default the minion will automatically include all config files from minion.d/*.conf where minion.d is relative to the directory of the minion configuration file.

INCLUDE
  Default: not defined
  The minion can include configuration from other files. To enable this, pass a list of paths to this option. The paths can be either relative or absolute; if relative, they are considered to be relative to the directory the main minion configuration
file lives in. Paths can make use of shell-style globbing. If no files are matched by a path passed to this option then the minion will log a warning message.

# Include files from a minion.d directory in the same
# directory as the minion config file
include: minion.d/*
# Include a single extra file into the configuration
include: /etc/roles/webserver
# Include several files and the minion.d directory
include:
- extra_config
- minion.d/*
- /etc/roles/webserver


FROZEN BUILD UPDATE SETTINGS
  These options control how salt.modules.saltutil.update() works
with esky frozen apps. For more information look at https://github.com/cloudmatrix/esky/.


UPDATE_URL
  Default: False (Update feature is disabled)
  The url to use when looking for application updates. Esky depends on directory listings to search for new versions. A webserver running on your Master is a good starting point for most setups.

update_url: 'http://salt.example.com/minion-updates'



UPDATE_RESTART_SERVICES
  Default: [] (service restarting on update is disabled)
  A list of services to restart when the minion software is updated. This would typically just be a list containing the minion's service name, but you may have other services that need to go with it.

update_restart_services: ['salt-minion']

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-143802-1-1.html 上篇帖子: saltstack官方文档——Full list of builtin state modules 下篇帖子: saltstack官方文档——The Top File
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表