summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support/salt/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-support/salt/files')
-rw-r--r--meta-openstack/recipes-support/salt/files/cloud99
-rw-r--r--meta-openstack/recipes-support/salt/files/master1034
-rw-r--r--meta-openstack/recipes-support/salt/files/minion802
-rw-r--r--meta-openstack/recipes-support/salt/files/roster9
-rwxr-xr-xmeta-openstack/recipes-support/salt/files/salt-api110
-rw-r--r--meta-openstack/recipes-support/salt/files/salt-common.bash_completion332
-rw-r--r--meta-openstack/recipes-support/salt/files/salt-common.logrotate23
-rwxr-xr-xmeta-openstack/recipes-support/salt/files/salt-master111
-rwxr-xr-xmeta-openstack/recipes-support/salt/files/salt-minion111
-rwxr-xr-xmeta-openstack/recipes-support/salt/files/salt-syndic111
10 files changed, 0 insertions, 2742 deletions
diff --git a/meta-openstack/recipes-support/salt/files/cloud b/meta-openstack/recipes-support/salt/files/cloud
deleted file mode 100644
index 921cc04..0000000
--- a/meta-openstack/recipes-support/salt/files/cloud
+++ /dev/null
@@ -1,99 +0,0 @@
1# This file should normally be installed at: /etc/salt/cloud
2
3
4##########################################
5##### VM Defaults #####
6##########################################
7
8# Set the size of minion keys to generate, defaults to 2048
9#
10#keysize: 2048
11
12
13# Set the default os being deployed. This sets which deployment script to
14# apply. This argument is optional.
15#
16#script: bootstrap-salt
17
18
19##########################################
20##### Logging Settings #####
21##########################################
22
23# The location of the master log file
24#
25#log_file: /var/log/salt/cloud
26
27
28# The level of messages to send to the console.
29# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
30#
31# The following log levels are considered INSECURE and may log sensitive data:
32# ['garbage', 'trace', 'debug']
33#
34# Default: 'info'
35#
36#log_level: info
37
38
39# The level of messages to send to the log file.
40# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
41#
42# Default: 'info'
43#
44#log_level_logfile: info
45
46
47# The date and time format used in log messages. Allowed date/time formatting
48# can be seen here:
49#
50# http://docs.python.org/library/time.html#time.strftime
51#
52#log_datefmt: '%Y-%m-%d %H:%M:%S'
53
54
55# The format of the console logging messages. Allowed formatting options can
56# be seen here:
57#
58# http://docs.python.org/library/logging.html#logrecord-attributes
59#
60# Console log colors are specified by these additional formatters:
61#
62# %(colorlevel)s
63# %(colorname)s
64# %(colorprocess)s
65# %(colormsg)s
66#
67# Since it is desirable to include the surrounding brackets, '[' and ']', in
68# the coloring of the messages, these color formatters also include padding as
69# well. Color LogRecord attributes are only available for console logging.
70#
71#log_fmt_console: '%(colorlevel)s %(colormsg)s'
72#log_fmt_console: '[%(levelname)-8s] %(message)s'
73#
74#log_fmt_logfile: '%(asctime)s,%(msecs)03d [%(name)-17s][%(levelname)-8s] %(message)s'
75
76
77# Logger levels can be used to tweak specific loggers logging levels.
78# For example, if you want to have the salt library at the 'warning' level,
79# but you still wish to have 'salt.modules' at the 'debug' level:
80#
81# log_granular_levels:
82# 'salt': 'warning',
83# 'salt.modules': 'debug'
84# 'saltcloud': 'info'
85#
86#log_granular_levels: {}
87
88
89##########################################
90##### Misc Defaults #####
91##########################################
92
93# Whether or not to remove the accompanying SSH key from the known_hosts file
94# when an instance is destroyed.
95#
96# Default: 'False'
97#
98#delete_sshkeys: False
99
diff --git a/meta-openstack/recipes-support/salt/files/master b/meta-openstack/recipes-support/salt/files/master
deleted file mode 100644
index 4ecb160..0000000
--- a/meta-openstack/recipes-support/salt/files/master
+++ /dev/null
@@ -1,1034 +0,0 @@
1##### Primary configuration settings #####
2##########################################
3# This configuration file is used to manage the behavior of the Salt Master.
4# Values that are commented out but have an empty line after the comment are
5# defaults that do not need to be set in the config. If there is no blank line
6# after the comment then the value is presented as an example and is not the
7# default.
8
9# Per default, the master will automatically include all config files
10# from master.d/*.conf (master.d is a directory in the same directory
11# as the main master config file).
12#default_include: master.d/*.conf
13
14# The address of the interface to bind to:
15#interface: 0.0.0.0
16
17# Whether the master should listen for IPv6 connections. If this is set to True,
18# the interface option must be adjusted, too. (For example: "interface: '::'")
19#ipv6: False
20
21# The tcp port used by the publisher:
22#publish_port: 4505
23
24# The user under which the salt master will run. Salt will update all
25# permissions to allow the specified user to run the master. The exception is
26# the job cache, which must be deleted if this user is changed. If the
27# modified files cause conflicts, set verify_env to False.
28#user: root
29
30# The port used by the communication interface. The ret (return) port is the
31# interface used for the file server, authentication, job returns, etc.
32#ret_port: 4506
33
34# Specify the location of the daemon process ID file:
35#pidfile: /var/run/salt-master.pid
36
37# The root directory prepended to these options: pki_dir, cachedir,
38# sock_dir, log_file, autosign_file, autoreject_file, extension_modules,
39# key_logfile, pidfile:
40#root_dir: /
41
42# The path to the master's configuration file.
43#conf_file: /etc/salt/master
44
45# Directory used to store public key data:
46#pki_dir: /etc/salt/pki/master
47
48# Key cache. Increases master speed for large numbers of accepted
49# keys. Available options: 'sched'. (Updates on a fixed schedule.)
50# Note that enabling this feature means that minions will not be
51# available to target for up to the length of the maintanence loop
52# which by default is 60s.
53#key_cache: ''
54
55# Directory to store job and cache data:
56# This directory may contain sensitive data and should be protected accordingly.
57#
58#cachedir: /var/cache/salt/master
59
60# Directory for custom modules. This directory can contain subdirectories for
61# each of Salt's module types such as "runners", "output", "wheel", "modules",
62# "states", "returners", etc.
63#extension_modules: <no default>
64
65# Directory for custom modules. This directory can contain subdirectories for
66# each of Salt's module types such as "runners", "output", "wheel", "modules",
67# "states", "returners", "engines", etc.
68# Like 'extension_modules' but can take an array of paths
69#module_dirs: <no default>
70# - /var/cache/salt/minion/extmods
71
72# Verify and set permissions on configuration directories at startup:
73#verify_env: True
74
75# Set the number of hours to keep old job information in the job cache:
76#keep_jobs: 24
77
78# The number of seconds to wait when the client is requesting information
79# about running jobs.
80#gather_job_timeout: 10
81
82# Set the default timeout for the salt command and api. The default is 5
83# seconds.
84#timeout: 5
85
86# The loop_interval option controls the seconds for the master's maintenance
87# process check cycle. This process updates file server backends, cleans the
88# job cache and executes the scheduler.
89#loop_interval: 60
90
91# Set the default outputter used by the salt command. The default is "nested".
92#output: nested
93
94# Set the default output file used by the salt command. Default is to output
95# to the CLI and not to a file. Functions the same way as the "--out-file"
96# CLI option, only sets this to a single file for all salt commands.
97#output_file: None
98
99# Return minions that timeout when running commands like test.ping
100#show_timeout: True
101
102# By default, output is colored. To disable colored output, set the color value
103# to False.
104#color: True
105
106# Do not strip off the colored output from nested results and state outputs
107# (true by default).
108# strip_colors: False
109
110# To display a summary of the number of minions targeted, the number of
111# minions returned, and the number of minions that did not return, set the
112# cli_summary value to True. (False by default.)
113#
114#cli_summary: False
115
116# Set the directory used to hold unix sockets:
117#sock_dir: /var/run/salt/master
118
119# The master can take a while to start up when lspci and/or dmidecode is used
120# to populate the grains for the master. Enable if you want to see GPU hardware
121# data for your master.
122# enable_gpu_grains: False
123
124# The master maintains a job cache. While this is a great addition, it can be
125# a burden on the master for larger deployments (over 5000 minions).
126# Disabling the job cache will make previously executed jobs unavailable to
127# the jobs system and is not generally recommended.
128#job_cache: True
129
130# Cache minion grains and pillar data in the cachedir.
131#minion_data_cache: True
132
133# Store all returns in the given returner.
134# Setting this option requires that any returner-specific configuration also
135# be set. See various returners in salt/returners for details on required
136# configuration values. (See also, event_return_queue below.)
137#
138#event_return: mysql
139
140# On busy systems, enabling event_returns can cause a considerable load on
141# the storage system for returners. Events can be queued on the master and
142# stored in a batched fashion using a single transaction for multiple events.
143# By default, events are not queued.
144#event_return_queue: 0
145
146# Only return events matching tags in a whitelist, supports glob matches.
147#event_return_whitelist:
148# - salt/master/a_tag
149# - salt/run/*/ret
150
151# Store all event returns **except** the tags in a blacklist, supports globs.
152#event_return_blacklist:
153# - salt/master/not_this_tag
154# - salt/wheel/*/ret
155
156# Passing very large events can cause the minion to consume large amounts of
157# memory. This value tunes the maximum size of a message allowed onto the
158# master event bus. The value is expressed in bytes.
159#max_event_size: 1048576
160
161# By default, the master AES key rotates every 24 hours. The next command
162# following a key rotation will trigger a key refresh from the minion which may
163# result in minions which do not respond to the first command after a key refresh.
164#
165# To tell the master to ping all minions immediately after an AES key refresh, set
166# ping_on_rotate to True. This should mitigate the issue where a minion does not
167# appear to initially respond after a key is rotated.
168#
169# Note that ping_on_rotate may cause high load on the master immediately after
170# the key rotation event as minions reconnect. Consider this carefully if this
171# salt master is managing a large number of minions.
172#
173# If disabled, it is recommended to handle this event by listening for the
174# 'aes_key_rotate' event with the 'key' tag and acting appropriately.
175# ping_on_rotate: False
176
177# By default, the master deletes its cache of minion data when the key for that
178# minion is removed. To preserve the cache after key deletion, set
179# 'preserve_minion_cache' to True.
180#
181# WARNING: This may have security implications if compromised minions auth with
182# a previous deleted minion ID.
183#preserve_minion_cache: False
184
185# If max_minions is used in large installations, the master might experience
186# high-load situations because of having to check the number of connected
187# minions for every authentication. This cache provides the minion-ids of
188# all connected minions to all MWorker-processes and greatly improves the
189# performance of max_minions.
190# con_cache: False
191
192# The master can include configuration from other files. To enable this,
193# pass a list of paths to this option. The paths can be either relative or
194# absolute; if relative, they are considered to be relative to the directory
195# the main master configuration file lives in (this file). Paths can make use
196# of shell-style globbing. If no files are matched by a path passed to this
197# option, then the master will log a warning message.
198#
199# Include a config file from some other path:
200# include: /etc/salt/extra_config
201#
202# Include config from several files and directories:
203# include:
204# - /etc/salt/extra_config
205
206
207##### Large-scale tuning settings #####
208##########################################
209# Max open files
210#
211# Each minion connecting to the master uses AT LEAST one file descriptor, the
212# master subscription connection. If enough minions connect you might start
213# seeing on the console (and then salt-master crashes):
214# Too many open files (tcp_listener.cpp:335)
215# Aborted (core dumped)
216#
217# By default this value will be the one of `ulimit -Hn`, ie, the hard limit for
218# max open files.
219#
220# If you wish to set a different value than the default one, uncomment and
221# configure this setting. Remember that this value CANNOT be higher than the
222# hard limit. Raising the hard limit depends on your OS and/or distribution,
223# a good way to find the limit is to search the internet. For example:
224# raise max open files hard limit debian
225#
226#max_open_files: 100000
227
228# The number of worker threads to start. These threads are used to manage
229# return calls made from minions to the master. If the master seems to be
230# running slowly, increase the number of threads. This setting can not be
231# set lower than 3.
232#worker_threads: 5
233
234# Set the ZeroMQ high water marks
235# http://api.zeromq.org/3-2:zmq-setsockopt
236
237# The publisher interface ZeroMQPubServerChannel
238#pub_hwm: 1000
239
240# These two ZMQ HWM settings, salt_event_pub_hwm and event_publisher_pub_hwm
241# are significant for masters with thousands of minions. When these are
242# insufficiently high it will manifest in random responses missing in the CLI
243# and even missing from the job cache. Masters that have fast CPUs and many
244# cores with appropriate worker_threads will not need these set as high.
245
246# On deployment with 8,000 minions, 2.4GHz CPUs, 24 cores, 32GiB memory has
247# these settings:
248#
249# salt_event_pub_hwm: 128000
250# event_publisher_pub_hwm: 64000
251
252# ZMQ high-water-mark for SaltEvent pub socket
253#salt_event_pub_hwm: 20000
254
255# ZMQ high-water-mark for EventPublisher pub socket
256#event_publisher_pub_hwm: 10000
257
258# The master may allocate memory per-event and not
259# reclaim it.
260# To set a high-water mark for memory allocation, use
261# ipc_write_buffer to set a high-water mark for message
262# buffering.
263# Value: In bytes. Set to 'dynamic' to have Salt select
264# a value for you. Default is disabled.
265# ipc_write_buffer: 'dynamic'
266
267
268##### Security settings #####
269##########################################
270# Enable "open mode", this mode still maintains encryption, but turns off
271# authentication, this is only intended for highly secure environments or for
272# the situation where your keys end up in a bad state. If you run in open mode
273# you do so at your own risk!
274#open_mode: False
275
276# Enable auto_accept, this setting will automatically accept all incoming
277# public keys from the minions. Note that this is insecure.
278#auto_accept: False
279
280# Time in minutes that an incoming public key with a matching name found in
281# pki_dir/minion_autosign/keyid is automatically accepted. Expired autosign keys
282# are removed when the master checks the minion_autosign directory.
283# 0 equals no timeout
284# autosign_timeout: 120
285
286# If the autosign_file is specified, incoming keys specified in the
287# autosign_file will be automatically accepted. This is insecure. Regular
288# expressions as well as globing lines are supported.
289#autosign_file: /etc/salt/autosign.conf
290
291# Works like autosign_file, but instead allows you to specify minion IDs for
292# which keys will automatically be rejected. Will override both membership in
293# the autosign_file and the auto_accept setting.
294#autoreject_file: /etc/salt/autoreject.conf
295
296# Enable permissive access to the salt keys. This allows you to run the
297# master or minion as root, but have a non-root group be given access to
298# your pki_dir. To make the access explicit, root must belong to the group
299# you've given access to. This is potentially quite insecure. If an autosign_file
300# is specified, enabling permissive_pki_access will allow group access to that
301# specific file.
302#permissive_pki_access: False
303
304# Allow users on the master access to execute specific commands on minions.
305# This setting should be treated with care since it opens up execution
306# capabilities to non root users. By default this capability is completely
307# disabled.
308#publisher_acl:
309# larry:
310# - test.ping
311# - network.*
312#
313# Blacklist any of the following users or modules
314#
315# This example would blacklist all non sudo users, including root from
316# running any commands. It would also blacklist any use of the "cmd"
317# module. This is completely disabled by default.
318#
319#
320# Check the list of configured users in client ACL against users on the
321# system and throw errors if they do not exist.
322#client_acl_verify: True
323#
324#publisher_acl_blacklist:
325# users:
326# - root
327# - '^(?!sudo_).*$' # all non sudo users
328# modules:
329# - cmd
330#
331# WARNING: client_acl and client_acl_blacklist options are deprecated and will
332# be removed in the future releases. Use publisher_acl and
333# publisher_acl_blacklist instead.
334
335# Enforce publisher_acl & publisher_acl_blacklist when users have sudo
336# access to the salt command.
337#
338#sudo_acl: False
339
340# The external auth system uses the Salt auth modules to authenticate and
341# validate users to access areas of the Salt system.
342#external_auth:
343# pam:
344# fred:
345# - test.*
346#
347# Time (in seconds) for a newly generated token to live. Default: 12 hours
348#token_expire: 43200
349#
350# Allow eauth users to specify the expiry time of the tokens they generate.
351# A boolean applies to all users or a dictionary of whitelisted eauth backends
352# and usernames may be given.
353# token_expire_user_override:
354# pam:
355# - fred
356# - tom
357# ldap:
358# - gary
359#
360#token_expire_user_override: False
361
362# Allow minions to push files to the master. This is disabled by default, for
363# security purposes.
364#file_recv: False
365
366# Set a hard-limit on the size of the files that can be pushed to the master.
367# It will be interpreted as megabytes. Default: 100
368#file_recv_max_size: 100
369
370# Signature verification on messages published from the master.
371# This causes the master to cryptographically sign all messages published to its event
372# bus, and minions then verify that signature before acting on the message.
373#
374# This is False by default.
375#
376# Note that to facilitate interoperability with masters and minions that are different
377# versions, if sign_pub_messages is True but a message is received by a minion with
378# no signature, it will still be accepted, and a warning message will be logged.
379# Conversely, if sign_pub_messages is False, but a minion receives a signed
380# message it will be accepted, the signature will not be checked, and a warning message
381# will be logged. This behavior went away in Salt 2014.1.0 and these two situations
382# will cause minion to throw an exception and drop the message.
383# sign_pub_messages: False
384
385##### Salt-SSH Configuration #####
386##########################################
387
388# Pass in an alternative location for the salt-ssh roster file
389#roster_file: /etc/salt/roster
390
391# Pass in minion option overrides that will be inserted into the SHIM for
392# salt-ssh calls. The local minion config is not used for salt-ssh. Can be
393# overridden on a per-minion basis in the roster (`minion_opts`)
394#ssh_minion_opts:
395# gpg_keydir: /root/gpg
396
397# Set this to True to default to using ~/.ssh/id_rsa for salt-ssh
398# authentication with minions
399#ssh_use_home_key: False
400
401##### Master Module Management #####
402##########################################
403# Manage how master side modules are loaded.
404
405# Add any additional locations to look for master runners:
406#runner_dirs: []
407
408# Enable Cython for master side modules:
409#cython_enable: False
410
411
412##### State System settings #####
413##########################################
414# The state system uses a "top" file to tell the minions what environment to
415# use and what modules to use. The state_top file is defined relative to the
416# root of the base environment as defined in "File Server settings" below.
417#state_top: top.sls
418
419# The master_tops option replaces the external_nodes option by creating
420# a plugable system for the generation of external top data. The external_nodes
421# option is deprecated by the master_tops option.
422#
423# To gain the capabilities of the classic external_nodes system, use the
424# following configuration:
425# master_tops:
426# ext_nodes: <Shell command which returns yaml>
427#
428#master_tops: {}
429
430# The external_nodes option allows Salt to gather data that would normally be
431# placed in a top file. The external_nodes option is the executable that will
432# return the ENC data. Remember that Salt will look for external nodes AND top
433# files and combine the results if both are enabled!
434#external_nodes: None
435
436# The renderer to use on the minions to render the state data
437#renderer: yaml_jinja
438
439# The Jinja renderer can strip extra carriage returns and whitespace
440# See http://jinja.pocoo.org/docs/api/#high-level-api
441#
442# If this is set to True the first newline after a Jinja block is removed
443# (block, not variable tag!). Defaults to False, corresponds to the Jinja
444# environment init variable "trim_blocks".
445#jinja_trim_blocks: False
446#
447# If this is set to True leading spaces and tabs are stripped from the start
448# of a line to a block. Defaults to False, corresponds to the Jinja
449# environment init variable "lstrip_blocks".
450#jinja_lstrip_blocks: False
451
452# The failhard option tells the minions to stop immediately after the first
453# failure detected in the state execution, defaults to False
454#failhard: False
455
456# The state_verbose and state_output settings can be used to change the way
457# state system data is printed to the display. By default all data is printed.
458# The state_verbose setting can be set to True or False, when set to False
459# all data that has a result of True and no changes will be suppressed.
460#state_verbose: True
461
462# The state_output setting changes if the output is the full multi line
463# output for each changed state if set to 'full', but if set to 'terse'
464# the output will be shortened to a single line. If set to 'mixed', the output
465# will be terse unless a state failed, in which case that output will be full.
466# If set to 'changes', the output will be full unless the state didn't change.
467#state_output: full
468
469# Automatically aggregate all states that have support for mod_aggregate by
470# setting to 'True'. Or pass a list of state module names to automatically
471# aggregate just those types.
472#
473# state_aggregate:
474# - pkg
475#
476#state_aggregate: False
477
478# Send progress events as each function in a state run completes execution
479# by setting to 'True'. Progress events are in the format
480# 'salt/job/<JID>/prog/<MID>/<RUN NUM>'.
481#state_events: False
482
483##### File Server settings #####
484##########################################
485# Salt runs a lightweight file server written in zeromq to deliver files to
486# minions. This file server is built into the master daemon and does not
487# require a dedicated port.
488
489# The file server works on environments passed to the master, each environment
490# can have multiple root directories, the subdirectories in the multiple file
491# roots cannot match, otherwise the downloaded files will not be able to be
492# reliably ensured. A base environment is required to house the top file.
493# Example:
494# file_roots:
495# base:
496# - /srv/salt/
497# dev:
498# - /srv/salt/dev/services
499# - /srv/salt/dev/states
500# prod:
501# - /srv/salt/prod/services
502# - /srv/salt/prod/states
503#
504#file_roots:
505# base:
506# - /srv/salt
507#
508
509# When using multiple environments, each with their own top file, the
510# default behaviour is an unordered merge. To prevent top files from
511# being merged together and instead to only use the top file from the
512# requested environment, set this value to 'same'.
513#top_file_merging_strategy: merge
514
515# To specify the order in which environments are merged, set the ordering
516# in the env_order option. Given a conflict, the last matching value will
517# win.
518#env_order: ['base', 'dev', 'prod']
519
520# If top_file_merging_strategy is set to 'same' and an environment does not
521# contain a top file, the top file in the environment specified by default_top
522# will be used instead.
523#default_top: base
524
525# The hash_type is the hash to use when discovering the hash of a file on
526# the master server. The default is md5 but sha1, sha224, sha256, sha384
527# and sha512 are also supported.
528#
529# WARNING: While md5 is also supported, do not use it due to the high chance
530# of possible collisions and thus security breach.
531#
532# Prior to changing this value, the master should be stopped and all Salt
533# caches should be cleared.
534#hash_type: sha256
535
536# The buffer size in the file server can be adjusted here:
537#file_buffer_size: 1048576
538
539# A regular expression (or a list of expressions) that will be matched
540# against the file path before syncing the modules and states to the minions.
541# This includes files affected by the file.recurse state.
542# For example, if you manage your custom modules and states in subversion
543# and don't want all the '.svn' folders and content synced to your minions,
544# you could set this to '/\.svn($|/)'. By default nothing is ignored.
545#file_ignore_regex:
546# - '/\.svn($|/)'
547# - '/\.git($|/)'
548
549# A file glob (or list of file globs) that will be matched against the file
550# path before syncing the modules and states to the minions. This is similar
551# to file_ignore_regex above, but works on globs instead of regex. By default
552# nothing is ignored.
553# file_ignore_glob:
554# - '*.pyc'
555# - '*/somefolder/*.bak'
556# - '*.swp'
557
558# File Server Backend
559#
560# Salt supports a modular fileserver backend system, this system allows
561# the salt master to link directly to third party systems to gather and
562# manage the files available to minions. Multiple backends can be
563# configured and will be searched for the requested file in the order in which
564# they are defined here. The default setting only enables the standard backend
565# "roots" which uses the "file_roots" option.
566#fileserver_backend:
567# - roots
568#
569# To use multiple backends list them in the order they are searched:
570#fileserver_backend:
571# - git
572# - roots
573#
574# Uncomment the line below if you do not want the file_server to follow
575# symlinks when walking the filesystem tree. This is set to True
576# by default. Currently this only applies to the default roots
577# fileserver_backend.
578#fileserver_followsymlinks: False
579#
580# Uncomment the line below if you do not want symlinks to be
581# treated as the files they are pointing to. By default this is set to
582# False. By uncommenting the line below, any detected symlink while listing
583# files on the Master will not be returned to the Minion.
584#fileserver_ignoresymlinks: True
585#
586# By default, the Salt fileserver recurses fully into all defined environments
587# to attempt to find files. To limit this behavior so that the fileserver only
588# traverses directories with SLS files and special Salt directories like _modules,
589# enable the option below. This might be useful for installations where a file root
590# has a very large number of files and performance is impacted. Default is False.
591# fileserver_limit_traversal: False
592#
593# The fileserver can fire events off every time the fileserver is updated,
594# these are disabled by default, but can be easily turned on by setting this
595# flag to True
596#fileserver_events: False
597
598# Git File Server Backend Configuration
599#
600# Optional parameter used to specify the provider to be used for gitfs. Must
601# be one of the following: pygit2, gitpython, or dulwich. If unset, then each
602# will be tried in that same order, and the first one with a compatible
603# version installed will be the provider that is used.
604#gitfs_provider: pygit2
605
606# Along with gitfs_password, is used to authenticate to HTTPS remotes.
607# gitfs_user: ''
608
609# Along with gitfs_user, is used to authenticate to HTTPS remotes.
610# This parameter is not required if the repository does not use authentication.
611#gitfs_password: ''
612
613# By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
614# This parameter enables authentication over HTTP. Enable this at your own risk.
615#gitfs_insecure_auth: False
616
617# Along with gitfs_privkey (and optionally gitfs_passphrase), is used to
618# authenticate to SSH remotes. This parameter (or its per-remote counterpart)
619# is required for SSH remotes.
620#gitfs_pubkey: ''
621
622# Along with gitfs_pubkey (and optionally gitfs_passphrase), is used to
623# authenticate to SSH remotes. This parameter (or its per-remote counterpart)
624# is required for SSH remotes.
625#gitfs_privkey: ''
626
627# This parameter is optional, required only when the SSH key being used to
628# authenticate is protected by a passphrase.
629#gitfs_passphrase: ''
630
631# When using the git fileserver backend at least one git remote needs to be
632# defined. The user running the salt master will need read access to the repo.
633#
634# The repos will be searched in order to find the file requested by a client
635# and the first repo to have the file will return it.
636# When using the git backend branches and tags are translated into salt
637# environments.
638# Note: file:// repos will be treated as a remote, so refs you want used must
639# exist in that repo as *local* refs.
640#gitfs_remotes:
641# - git://github.com/saltstack/salt-states.git
642# - file:///var/git/saltmaster
643#
644# The gitfs_ssl_verify option specifies whether to ignore ssl certificate
645# errors when contacting the gitfs backend. You might want to set this to
646# false if you're using a git backend that uses a self-signed certificate but
647# keep in mind that setting this flag to anything other than the default of True
648# is a security concern, you may want to try using the ssh transport.
649#gitfs_ssl_verify: True
650#
651# The gitfs_root option gives the ability to serve files from a subdirectory
652# within the repository. The path is defined relative to the root of the
653# repository and defaults to the repository root.
654#gitfs_root: somefolder/otherfolder
655#
656#
657##### Pillar settings #####
658##########################################
659# Salt Pillars allow for the building of global data that can be made selectively
660# available to different minions based on minion grain filtering. The Salt
661# Pillar is laid out in the same fashion as the file server, with environments,
662# a top file and sls files. However, pillar data does not need to be in the
663# highstate format, and is generally just key/value pairs.
664#pillar_roots:
665# base:
666# - /srv/pillar
667#
668#ext_pillar:
669# - hiera: /etc/hiera.yaml
670# - cmd_yaml: cat /etc/salt/yaml
671
672# The ext_pillar_first option allows for external pillar sources to populate
673# before file system pillar. This allows for targeting file system pillar from
674# ext_pillar.
675#ext_pillar_first: False
676
677# The pillar_gitfs_ssl_verify option specifies whether to ignore ssl certificate
678# errors when contacting the pillar gitfs backend. You might want to set this to
679# false if you're using a git backend that uses a self-signed certificate but
680# keep in mind that setting this flag to anything other than the default of True
681# is a security concern, you may want to try using the ssh transport.
682#pillar_gitfs_ssl_verify: True
683
684# The pillar_opts option adds the master configuration file data to a dict in
685# the pillar called "master". This is used to set simple configurations in the
686# master config file that can then be used on minions.
687#pillar_opts: False
688
689# The pillar_safe_render_error option prevents the master from passing pillar
690# render errors to the minion. This is set on by default because the error could
691# contain templating data which would give that minion information it shouldn't
692# have, like a password! When set true the error message will only show:
693# Rendering SLS 'my.sls' failed. Please see master log for details.
694#pillar_safe_render_error: True
695
696# The pillar_source_merging_strategy option allows you to configure merging strategy
697# between different sources. It accepts five values: none, recurse, aggregate, overwrite,
698# or smart. None will not do any merging at all. Recurse will merge recursively mapping of data.
699# Aggregate instructs aggregation of elements between sources that use the #!yamlex renderer. Overwrite
700# will overwrite elements according the order in which they are processed. This is
701# behavior of the 2014.1 branch and earlier. Smart guesses the best strategy based
702# on the "renderer" setting and is the default value.
703#pillar_source_merging_strategy: smart
704
705# Recursively merge lists by aggregating them instead of replacing them.
706#pillar_merge_lists: False
707
708# Set this option to 'True' to force a 'KeyError' to be raised whenever an
709# attempt to retrieve a named value from pillar fails. When this option is set
710# to 'False', the failed attempt returns an empty string. Default is 'False'.
711#pillar_raise_on_missing: False
712
713# Git External Pillar (git_pillar) Configuration Options
714#
715# Specify the provider to be used for git_pillar. Must be either pygit2 or
716# gitpython. If unset, then both will be tried in that same order, and the
717# first one with a compatible version installed will be the provider that
718# is used.
719#git_pillar_provider: pygit2
720
721# If the desired branch matches this value, and the environment is omitted
722# from the git_pillar configuration, then the environment for that git_pillar
723# remote will be base.
724#git_pillar_base: master
725
726# If the branch is omitted from a git_pillar remote, then this branch will
727# be used instead
728#git_pillar_branch: master
729
730# Environment to use for git_pillar remotes. This is normally derived from
731# the branch/tag (or from a per-remote env parameter), but if set this will
732# override the process of deriving the env from the branch/tag name.
733#git_pillar_env: ''
734
735# Path relative to the root of the repository where the git_pillar top file
736# and SLS files are located.
737#git_pillar_root: ''
738
739# Specifies whether or not to ignore SSL certificate errors when contacting
740# the remote repository.
741#git_pillar_ssl_verify: False
742
743# When set to False, if there is an update/checkout lock for a git_pillar
744# remote and the pid written to it is not running on the master, the lock
745# file will be automatically cleared and a new lock will be obtained.
746#git_pillar_global_lock: True
747
748# Git External Pillar Authentication Options
749#
750# Along with git_pillar_password, is used to authenticate to HTTPS remotes.
751#git_pillar_user: ''
752
753# Along with git_pillar_user, is used to authenticate to HTTPS remotes.
754# This parameter is not required if the repository does not use authentication.
755#git_pillar_password: ''
756
757# By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
758# This parameter enables authentication over HTTP.
759#git_pillar_insecure_auth: False
760
761# Along with git_pillar_privkey (and optionally git_pillar_passphrase),
762# is used to authenticate to SSH remotes.
763#git_pillar_pubkey: ''
764
765# Along with git_pillar_pubkey (and optionally git_pillar_passphrase),
766# is used to authenticate to SSH remotes.
767#git_pillar_privkey: ''
768
769# This parameter is optional, required only when the SSH key being used
770# to authenticate is protected by a passphrase.
771#git_pillar_passphrase: ''
772
773# A master can cache pillars locally to bypass the expense of having to render them
774# for each minion on every request. This feature should only be enabled in cases
775# where pillar rendering time is known to be unsatisfactory and any attendant security
776# concerns about storing pillars in a master cache have been addressed.
777#
778# When enabling this feature, be certain to read through the additional ``pillar_cache_*``
779# configuration options to fully understand the tunable parameters and their implications.
780#
781# Note: setting ``pillar_cache: True`` has no effect on targeting Minions with Pillars.
782# See https://docs.saltstack.com/en/latest/topics/targeting/pillar.html
783#pillar_cache: False
784
785# If and only if a master has set ``pillar_cache: True``, the cache TTL controls the amount
786# of time, in seconds, before the cache is considered invalid by a master and a fresh
787# pillar is recompiled and stored.
788#pillar_cache_ttl: 3600
789
790# If and only if a master has set `pillar_cache: True`, one of several storage providers
791# can be utililzed.
792#
793# `disk`: The default storage backend. This caches rendered pillars to the master cache.
794# Rendered pillars are serialized and deserialized as msgpack structures for speed.
795# Note that pillars are stored UNENCRYPTED. Ensure that the master cache
796# has permissions set appropriately. (Same defaults are provided.)
797#
798# memory: [EXPERIMENTAL] An optional backend for pillar caches which uses a pure-Python
799# in-memory data structure for maximal performance. There are several caveats,
800# however. First, because each master worker contains its own in-memory cache,
801# there is no guarantee of cache consistency between minion requests. This
802# works best in situations where the pillar rarely if ever changes. Secondly,
803# and perhaps more importantly, this means that unencrypted pillars will
804# be accessible to any process which can examine the memory of the ``salt-master``!
805# This may represent a substantial security risk.
806#
807#pillar_cache_backend: disk
808
809
810##### Syndic settings #####
811##########################################
812# The Salt syndic is used to pass commands through a master from a higher
813# master. Using the syndic is simple. If this is a master that will have
814# syndic servers(s) below it, then set the "order_masters" setting to True.
815#
816# If this is a master that will be running a syndic daemon for passthrough, then
817# the "syndic_master" setting needs to be set to the location of the master server
818# to receive commands from.
819
820# Set the order_masters setting to True if this master will command lower
821# masters' syndic interfaces.
822#order_masters: False
823
824# If this master will be running a salt syndic daemon, syndic_master tells
825# this master where to receive commands from.
826#syndic_master: masterofmaster
827
828# This is the 'ret_port' of the MasterOfMaster:
829#syndic_master_port: 4506
830
831# PID file of the syndic daemon:
832#syndic_pidfile: /var/run/salt-syndic.pid
833
834# LOG file of the syndic daemon:
835#syndic_log_file: syndic.log
836
837# The behaviour of the multi-syndic when connection to a master of masters failed.
838# Can specify ``random`` (default) or ``ordered``. If set to ``random``, masters
839# will be iterated in random order. If ``ordered`` is specified, the configured
840# order will be used.
841#syndic_failover: random
842
843
844##### Peer Publish settings #####
845##########################################
846# Salt minions can send commands to other minions, but only if the minion is
847# allowed to. By default "Peer Publication" is disabled, and when enabled it
848# is enabled for specific minions and specific commands. This allows secure
849# compartmentalization of commands based on individual minions.
850
851# The configuration uses regular expressions to match minions and then a list
852# of regular expressions to match functions. The following will allow the
853# minion authenticated as foo.example.com to execute functions from the test
854# and pkg modules.
855#peer:
856# foo.example.com:
857# - test.*
858# - pkg.*
859#
860# This will allow all minions to execute all commands:
861#peer:
862# .*:
863# - .*
864#
865# This is not recommended, since it would allow anyone who gets root on any
866# single minion to instantly have root on all of the minions!
867
868# Minions can also be allowed to execute runners from the salt master.
869# Since executing a runner from the minion could be considered a security risk,
870# it needs to be enabled. This setting functions just like the peer setting
871# except that it opens up runners instead of module functions.
872#
873# All peer runner support is turned off by default and must be enabled before
874# using. This will enable all peer runners for all minions:
875#peer_run:
876# .*:
877# - .*
878#
879# To enable just the manage.up runner for the minion foo.example.com:
880#peer_run:
881# foo.example.com:
882# - manage.up
883#
884#
885##### Mine settings #####
886#####################################
887# Restrict mine.get access from minions. By default any minion has a full access
888# to get all mine data from master cache. In acl definion below, only pcre matches
889# are allowed.
890# mine_get:
891# .*:
892# - .*
893#
894# The example below enables minion foo.example.com to get 'network.interfaces' mine
895# data only, minions web* to get all network.* and disk.* mine data and all other
896# minions won't get any mine data.
897# mine_get:
898# foo.example.com:
899# - network.interfaces
900# web.*:
901# - network.*
902# - disk.*
903
904
905##### Logging settings #####
906##########################################
907# The location of the master log file
908# The master log can be sent to a regular file, local path name, or network
909# location. Remote logging works best when configured to use rsyslogd(8) (e.g.:
910# ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI
911# format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>
912#log_file: /var/log/salt/master
913#log_file: file:///dev/log
914#log_file: udp://loghost:10514
915
916#log_file: /var/log/salt/master
917#key_logfile: /var/log/salt/key
918
919# The level of messages to send to the console.
920# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
921#
922# The following log levels are considered INSECURE and may log sensitive data:
923# ['garbage', 'trace', 'debug']
924#
925#log_level: warning
926
927# The level of messages to send to the log file.
928# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
929# If using 'log_granular_levels' this must be set to the highest desired level.
930#log_level_logfile: warning
931
932# The date and time format used in log messages. Allowed date/time formatting
933# can be seen here: http://docs.python.org/library/time.html#time.strftime
934#log_datefmt: '%H:%M:%S'
935#log_datefmt_logfile: '%Y-%m-%d %H:%M:%S'
936
937# The format of the console logging messages. Allowed formatting options can
938# be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
939#
940# Console log colors are specified by these additional formatters:
941#
942# %(colorlevel)s
943# %(colorname)s
944# %(colorprocess)s
945# %(colormsg)s
946#
947# Since it is desirable to include the surrounding brackets, '[' and ']', in
948# the coloring of the messages, these color formatters also include padding as
949# well. Color LogRecord attributes are only available for console logging.
950#
951#log_fmt_console: '%(colorlevel)s %(colormsg)s'
952#log_fmt_console: '[%(levelname)-8s] %(message)s'
953#
954#log_fmt_logfile: '%(asctime)s,%(msecs)03d [%(name)-17s][%(levelname)-8s] %(message)s'
955
956# This can be used to control logging levels more specificically. This
957# example sets the main salt library at the 'warning' level, but sets
958# 'salt.modules' to log at the 'debug' level:
959# log_granular_levels:
960# 'salt': 'warning'
961# 'salt.modules': 'debug'
962#
963#log_granular_levels: {}
964
965
966##### Node Groups ######
967##########################################
968# Node groups allow for logical groupings of minion nodes. A group consists of
969# a group name and a compound target. Nodgroups can reference other nodegroups
970# with 'N@' classifier. Ensure that you do not have circular references.
971#
972#nodegroups:
973# group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com or bl*.domain.com'
974# group2: 'G@os:Debian and foo.domain.com'
975# group3: 'G@os:Debian and N@group1'
976# group4:
977# - 'G@foo:bar'
978# - 'or'
979# - 'G@foo:baz'
980
981
982##### Range Cluster settings #####
983##########################################
984# The range server (and optional port) that serves your cluster information
985# https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
986#
987#range_server: range:80
988
989
990##### Windows Software Repo settings #####
991###########################################
992# Location of the repo on the master:
993#winrepo_dir_ng: '/srv/salt/win/repo-ng'
994#
995# List of git repositories to include with the local repo:
996#winrepo_remotes_ng:
997# - 'https://github.com/saltstack/salt-winrepo-ng.git'
998
999
1000##### Windows Software Repo settings - Pre 2015.8 #####
1001########################################################
1002# Legacy repo settings for pre-2015.8 Windows minions.
1003#
1004# Location of the repo on the master:
1005#winrepo_dir: '/srv/salt/win/repo'
1006#
1007# Location of the master's repo cache file:
1008#winrepo_mastercachefile: '/srv/salt/win/repo/winrepo.p'
1009#
1010# List of git repositories to include with the local repo:
1011#winrepo_remotes:
1012# - 'https://github.com/saltstack/salt-winrepo.git'
1013
1014
1015##### Returner settings ######
1016############################################
1017# Which returner(s) will be used for minion's result:
1018#return: mysql
1019
1020
1021###### Miscellaneous settings ######
1022############################################
1023# Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch
1024#event_match_type: startswith
1025
1026# Save runner returns to the job cache
1027#runner_returns: True
1028
1029# Permanently include any available Python 3rd party modules into Salt Thin
1030# when they are generated for Salt-SSH or other purposes.
1031# The modules should be named by the names they are actually imported inside the Python.
1032# The value of the parameters can be either one module or a comma separated list of them.
1033#thin_extra_mods: foo,bar
1034
diff --git a/meta-openstack/recipes-support/salt/files/minion b/meta-openstack/recipes-support/salt/files/minion
deleted file mode 100644
index ad7a374..0000000
--- a/meta-openstack/recipes-support/salt/files/minion
+++ /dev/null
@@ -1,802 +0,0 @@
1##### Primary configuration settings #####
2##########################################
3# This configuration file is used to manage the behavior of the Salt Minion.
4# With the exception of the location of the Salt Master Server, values that are
5# commented out but have an empty line after the comment are defaults that need
6# not be set in the config. If there is no blank line after the comment, the
7# value is presented as an example and is not the default.
8
9# Per default the minion will automatically include all config files
10# from minion.d/*.conf (minion.d is a directory in the same directory
11# as the main minion config file).
12#default_include: minion.d/*.conf
13
14# Set the location of the salt master server. If the master server cannot be
15# resolved, then the minion will fail to start.
16#master: salt
17
18# Set http proxy information for the minion when doing requests
19#proxy_host:
20#proxy_port:
21#proxy_username:
22#proxy_password:
23
24# If multiple masters are specified in the 'master' setting, the default behavior
25# is to always try to connect to them in the order they are listed. If random_master is
26# set to True, the order will be randomized instead. This can be helpful in distributing
27# the load of many minions executing salt-call requests, for example, from a cron job.
28# If only one master is listed, this setting is ignored and a warning will be logged.
29# NOTE: If master_type is set to failover, use master_shuffle instead.
30#random_master: False
31
32# Use if master_type is set to failover.
33#master_shuffle: False
34
35# Minions can connect to multiple masters simultaneously (all masters
36# are "hot"), or can be configured to failover if a master becomes
37# unavailable. Multiple hot masters are configured by setting this
38# value to "str". Failover masters can be requested by setting
39# to "failover". MAKE SURE TO SET master_alive_interval if you are
40# using failover.
41# Setting master_type to 'disable' let's you have a running minion (with engines and
42# beacons) without a master connection
43# master_type: str
44
45# Poll interval in seconds for checking if the master is still there. Only
46# respected if master_type above is "failover". To disable the interval entirely,
47# set the value to -1. (This may be necessary on machines which have high numbers
48# of TCP connections, such as load balancers.)
49# master_alive_interval: 30
50
51# If the minion is in multi-master mode and the master_type configuration option
52# is set to "failover", this setting can be set to "True" to force the minion
53# to fail back to the first master in the list if the first master is back online.
54#master_failback: False
55
56# If the minion is in multi-master mode, the "master_type" configuration is set to
57# "failover", and the "master_failback" option is enabled, the master failback
58# interval can be set to ping the top master with this interval, in seconds.
59#master_failback_interval: 0
60
61# Set whether the minion should connect to the master via IPv6:
62#ipv6: False
63
64# Set the number of seconds to wait before attempting to resolve
65# the master hostname if name resolution fails. Defaults to 30 seconds.
66# Set to zero if the minion should shutdown and not retry.
67# retry_dns: 30
68
69# Set the port used by the master reply and authentication server.
70#master_port: 4506
71
72# The user to run salt.
73#user: root
74
75# The user to run salt remote execution commands as via sudo. If this option is
76# enabled then sudo will be used to change the active user executing the remote
77# command. If enabled the user will need to be allowed access via the sudoers
78# file for the user that the salt minion is configured to run as. The most
79# common option would be to use the root user. If this option is set the user
80# option should also be set to a non-root user. If migrating from a root minion
81# to a non root minion the minion cache should be cleared and the minion pki
82# directory will need to be changed to the ownership of the new user.
83#sudo_user: root
84
85# Specify the location of the daemon process ID file.
86#pidfile: /var/run/salt-minion.pid
87
88# The root directory prepended to these options: pki_dir, cachedir, log_file,
89# sock_dir, pidfile.
90#root_dir: /
91
92# The path to the minion's configuration file.
93#conf_file: /etc/salt/minion
94
95# The directory to store the pki information in
96#pki_dir: /etc/salt/pki/minion
97
98# Explicitly declare the id for this minion to use, if left commented the id
99# will be the hostname as returned by the python call: socket.getfqdn()
100# Since salt uses detached ids it is possible to run multiple minions on the
101# same machine but with different ids, this can be useful for salt compute
102# clusters.
103#id:
104
105# Cache the minion id to a file when the minion's id is not statically defined
106# in the minion config. Defaults to "True". This setting prevents potential
107# problems when automatic minion id resolution changes, which can cause the
108# minion to lose connection with the master. To turn off minion id caching,
109# set this config to ``False``.
110#minion_id_caching: True
111
112# Append a domain to a hostname in the event that it does not exist. This is
113# useful for systems where socket.getfqdn() does not actually result in a
114# FQDN (for instance, Solaris).
115#append_domain:
116
117# Custom static grains for this minion can be specified here and used in SLS
118# files just like all other grains. This example sets 4 custom grains, with
119# the 'roles' grain having two values that can be matched against.
120#grains:
121# roles:
122# - webserver
123# - memcache
124# deployment: datacenter4
125# cabinet: 13
126# cab_u: 14-15
127#
128# Where cache data goes.
129# This data may contain sensitive data and should be protected accordingly.
130#cachedir: /var/cache/salt/minion
131
132# Append minion_id to these directories. Helps with
133# multiple proxies and minions running on the same machine.
134# Allowed elements in the list: pki_dir, cachedir, extension_modules
135# Normally not needed unless running several proxies and/or minions on the same machine
136# Defaults to ['cachedir'] for proxies, [] (empty list) for regular minions
137#append_minionid_config_dirs:
138
139# Verify and set permissions on configuration directories at startup.
140#verify_env: True
141
142# The minion can locally cache the return data from jobs sent to it, this
143# can be a good way to keep track of jobs the minion has executed
144# (on the minion side). By default this feature is disabled, to enable, set
145# cache_jobs to True.
146#cache_jobs: False
147
148# Set the directory used to hold unix sockets.
149#sock_dir: /var/run/salt/minion
150
151# Set the default outputter used by the salt-call command. The default is
152# "nested".
153#output: nested
154#
155# By default output is colored. To disable colored output, set the color value
156# to False.
157#color: True
158
159# Do not strip off the colored output from nested results and state outputs
160# (true by default).
161# strip_colors: False
162
163# Backup files that are replaced by file.managed and file.recurse under
164# 'cachedir'/file_backups relative to their original location and appended
165# with a timestamp. The only valid setting is "minion". Disabled by default.
166#
167# Alternatively this can be specified for each file in state files:
168# /etc/ssh/sshd_config:
169# file.managed:
170# - source: salt://ssh/sshd_config
171# - backup: minion
172#
173#backup_mode: minion
174
175# When waiting for a master to accept the minion's public key, salt will
176# continuously attempt to reconnect until successful. This is the time, in
177# seconds, between those reconnection attempts.
178#acceptance_wait_time: 10
179
180# If this is nonzero, the time between reconnection attempts will increase by
181# acceptance_wait_time seconds per iteration, up to this maximum. If this is
182# set to zero, the time between reconnection attempts will stay constant.
183#acceptance_wait_time_max: 0
184
185# If the master rejects the minion's public key, retry instead of exiting.
186# Rejected keys will be handled the same as waiting on acceptance.
187#rejected_retry: False
188
189# When the master key changes, the minion will try to re-auth itself to receive
190# the new master key. In larger environments this can cause a SYN flood on the
191# master because all minions try to re-auth immediately. To prevent this and
192# have a minion wait for a random amount of time, use this optional parameter.
193# The wait-time will be a random number of seconds between 0 and the defined value.
194#random_reauth_delay: 60
195
196# When waiting for a master to accept the minion's public key, salt will
197# continuously attempt to reconnect until successful. This is the timeout value,
198# in seconds, for each individual attempt. After this timeout expires, the minion
199# will wait for acceptance_wait_time seconds before trying again. Unless your master
200# is under unusually heavy load, this should be left at the default.
201#auth_timeout: 60
202
203# Number of consecutive SaltReqTimeoutError that are acceptable when trying to
204# authenticate.
205#auth_tries: 7
206
207# The number of attempts to connect to a master before giving up.
208# Set this to -1 for unlimited attempts. This allows for a master to have
209# downtime and the minion to reconnect to it later when it comes back up.
210# In 'failover' mode, it is the number of attempts for each set of masters.
211# In this mode, it will cycle through the list of masters for each attempt.
212#
213# This is different than auth_tries because auth_tries attempts to
214# retry auth attempts with a single master. auth_tries is under the
215# assumption that you can connect to the master but not gain
216# authorization from it. master_tries will still cycle through all
217# the masters in a given try, so it is appropriate if you expect
218# occasional downtime from the master(s).
219#master_tries: 1
220
221# If authentication fails due to SaltReqTimeoutError during a ping_interval,
222# cause sub minion process to restart.
223#auth_safemode: False
224
225# Ping Master to ensure connection is alive (minutes).
226#ping_interval: 0
227
228# To auto recover minions if master changes IP address (DDNS)
229# auth_tries: 10
230# auth_safemode: False
231# ping_interval: 90
232#
233# Minions won't know master is missing until a ping fails. After the ping fail,
234# the minion will attempt authentication and likely fails out and cause a restart.
235# When the minion restarts it will resolve the masters IP and attempt to reconnect.
236
237# If you don't have any problems with syn-floods, don't bother with the
238# three recon_* settings described below, just leave the defaults!
239#
240# The ZeroMQ pull-socket that binds to the masters publishing interface tries
241# to reconnect immediately, if the socket is disconnected (for example if
242# the master processes are restarted). In large setups this will have all
243# minions reconnect immediately which might flood the master (the ZeroMQ-default
244# is usually a 100ms delay). To prevent this, these three recon_* settings
245# can be used.
246# recon_default: the interval in milliseconds that the socket should wait before
247# trying to reconnect to the master (1000ms = 1 second)
248#
249# recon_max: the maximum time a socket should wait. each interval the time to wait
250# is calculated by doubling the previous time. if recon_max is reached,
251# it starts again at recon_default. Short example:
252#
253# reconnect 1: the socket will wait 'recon_default' milliseconds
254# reconnect 2: 'recon_default' * 2
255# reconnect 3: ('recon_default' * 2) * 2
256# reconnect 4: value from previous interval * 2
257# reconnect 5: value from previous interval * 2
258# reconnect x: if value >= recon_max, it starts again with recon_default
259#
260# recon_randomize: generate a random wait time on minion start. The wait time will
261# be a random value between recon_default and recon_default +
262# recon_max. Having all minions reconnect with the same recon_default
263# and recon_max value kind of defeats the purpose of being able to
264# change these settings. If all minions have the same values and your
265# setup is quite large (several thousand minions), they will still
266# flood the master. The desired behavior is to have timeframe within
267# all minions try to reconnect.
268#
269# Example on how to use these settings. The goal: have all minions reconnect within a
270# 60 second timeframe on a disconnect.
271# recon_default: 1000
272# recon_max: 59000
273# recon_randomize: True
274#
275# Each minion will have a randomized reconnect value between 'recon_default'
276# and 'recon_default + recon_max', which in this example means between 1000ms
277# 60000ms (or between 1 and 60 seconds). The generated random-value will be
278# doubled after each attempt to reconnect. Lets say the generated random
279# value is 11 seconds (or 11000ms).
280# reconnect 1: wait 11 seconds
281# reconnect 2: wait 22 seconds
282# reconnect 3: wait 33 seconds
283# reconnect 4: wait 44 seconds
284# reconnect 5: wait 55 seconds
285# reconnect 6: wait time is bigger than 60 seconds (recon_default + recon_max)
286# reconnect 7: wait 11 seconds
287# reconnect 8: wait 22 seconds
288# reconnect 9: wait 33 seconds
289# reconnect x: etc.
290#
291# In a setup with ~6000 thousand hosts these settings would average the reconnects
292# to about 100 per second and all hosts would be reconnected within 60 seconds.
293# recon_default: 100
294# recon_max: 5000
295# recon_randomize: False
296#
297#
298# The loop_interval sets how long in seconds the minion will wait between
299# evaluating the scheduler and running cleanup tasks. This defaults to 1
300# second on the minion scheduler.
301#loop_interval: 1
302
303# Some installations choose to start all job returns in a cache or a returner
304# and forgo sending the results back to a master. In this workflow, jobs
305# are most often executed with --async from the Salt CLI and then results
306# are evaluated by examining job caches on the minions or any configured returners.
307# WARNING: Setting this to False will **disable** returns back to the master.
308#pub_ret: True
309
310
311# The grains can be merged, instead of overridden, using this option.
312# This allows custom grains to defined different subvalues of a dictionary
313# grain. By default this feature is disabled, to enable set grains_deep_merge
314# to ``True``.
315#grains_deep_merge: False
316
317# The grains_refresh_every setting allows for a minion to periodically check
318# its grains to see if they have changed and, if so, to inform the master
319# of the new grains. This operation is moderately expensive, therefore
320# care should be taken not to set this value too low.
321#
322# Note: This value is expressed in __minutes__!
323#
324# A value of 10 minutes is a reasonable default.
325#
326# If the value is set to zero, this check is disabled.
327#grains_refresh_every: 1
328
329# Cache grains on the minion. Default is False.
330#grains_cache: False
331
332# Cache rendered pillar data on the minion. Default is False.
333# This may cause 'cachedir'/pillar to contain sensitive data that should be
334# protected accordingly.
335#minion_pillar_cache: False
336
337# Grains cache expiration, in seconds. If the cache file is older than this
338# number of seconds then the grains cache will be dumped and fully re-populated
339# with fresh data. Defaults to 5 minutes. Will have no effect if 'grains_cache'
340# is not enabled.
341# grains_cache_expiration: 300
342
343# Determines whether or not the salt minion should run scheduled mine updates.
344# Defaults to "True". Set to "False" to disable the scheduled mine updates
345# (this essentially just does not add the mine update function to the minion's
346# scheduler).
347#mine_enabled: True
348
349# Determines whether or not scheduled mine updates should be accompanied by a job
350# return for the job cache. Defaults to "False". Set to "True" to include job
351# returns in the job cache for mine updates.
352#mine_return_job: False
353
354# Example functions that can be run via the mine facility
355# NO mine functions are established by default.
356# Note these can be defined in the minion's pillar as well.
357#mine_functions:
358# test.ping: []
359# network.ip_addrs:
360# interface: eth0
361# cidr: '10.0.0.0/8'
362
363# Windows platforms lack posix IPC and must rely on slower TCP based inter-
364# process communications. Set ipc_mode to 'tcp' on such systems
365#ipc_mode: ipc
366
367# Overwrite the default tcp ports used by the minion when in tcp mode
368#tcp_pub_port: 4510
369#tcp_pull_port: 4511
370
371# Passing very large events can cause the minion to consume large amounts of
372# memory. This value tunes the maximum size of a message allowed onto the
373# minion event bus. The value is expressed in bytes.
374#max_event_size: 1048576
375
376# To detect failed master(s) and fire events on connect/disconnect, set
377# master_alive_interval to the number of seconds to poll the masters for
378# connection events.
379#
380#master_alive_interval: 30
381
382# The minion can include configuration from other files. To enable this,
383# pass a list of paths to this option. The paths can be either relative or
384# absolute; if relative, they are considered to be relative to the directory
385# the main minion configuration file lives in (this file). Paths can make use
386# of shell-style globbing. If no files are matched by a path passed to this
387# option then the minion will log a warning message.
388#
389# Include a config file from some other path:
390# include: /etc/salt/extra_config
391#
392# Include config from several files and directories:
393#include:
394# - /etc/salt/extra_config
395# - /etc/roles/webserver
396
397# The syndic minion can verify that it is talking to the correct master via the
398# key fingerprint of the higher-level master with the "syndic_finger" config.
399#syndic_finger: ''
400#
401#
402#
403##### Minion module management #####
404##########################################
405# Disable specific modules. This allows the admin to limit the level of
406# access the master has to the minion. The default here is the empty list,
407# below is an example of how this needs to be formatted in the config file
408#disable_modules:
409# - cmdmod
410# - test
411#disable_returners: []
412
413# This is the reverse of disable_modules. The default, like disable_modules, is the empty list,
414# but if this option is set to *anything* then *only* those modules will load.
415# Note that this is a very large hammer and it can be quite difficult to keep the minion working
416# the way you think it should since Salt uses many modules internally itself. At a bare minimum
417# you need the following enabled or else the minion won't start.
418#whitelist_modules:
419# - cmdmod
420# - test
421# - config
422
423# Modules can be loaded from arbitrary paths. This enables the easy deployment
424# of third party modules. Modules for returners and minions can be loaded.
425# Specify a list of extra directories to search for minion modules and
426# returners. These paths must be fully qualified!
427#module_dirs: []
428#returner_dirs: []
429#states_dirs: []
430#render_dirs: []
431#utils_dirs: []
432#
433# A module provider can be statically overwritten or extended for the minion
434# via the providers option, in this case the default module will be
435# overwritten by the specified module. In this example the pkg module will
436# be provided by the yumpkg5 module instead of the system default.
437#providers:
438# pkg: yumpkg5
439#
440# Enable Cython modules searching and loading. (Default: False)
441#cython_enable: False
442#
443# Specify a max size (in bytes) for modules on import. This feature is currently
444# only supported on *nix operating systems and requires psutil.
445# modules_max_memory: -1
446
447
448##### State Management Settings #####
449###########################################
450# The state management system executes all of the state templates on the minion
451# to enable more granular control of system state management. The type of
452# template and serialization used for state management needs to be configured
453# on the minion, the default renderer is yaml_jinja. This is a yaml file
454# rendered from a jinja template, the available options are:
455# yaml_jinja
456# yaml_mako
457# yaml_wempy
458# json_jinja
459# json_mako
460# json_wempy
461#
462#renderer: yaml_jinja
463#
464# The failhard option tells the minions to stop immediately after the first
465# failure detected in the state execution. Defaults to False.
466#failhard: False
467#
468# Reload the modules prior to a highstate run.
469#autoload_dynamic_modules: True
470#
471# clean_dynamic_modules keeps the dynamic modules on the minion in sync with
472# the dynamic modules on the master, this means that if a dynamic module is
473# not on the master it will be deleted from the minion. By default, this is
474# enabled and can be disabled by changing this value to False.
475#clean_dynamic_modules: True
476#
477# Normally, the minion is not isolated to any single environment on the master
478# when running states, but the environment can be isolated on the minion side
479# by statically setting it. Remember that the recommended way to manage
480# environments is to isolate via the top file.
481#environment: None
482#
483# Isolates the pillar environment on the minion side. This functions the same
484# as the environment setting, but for pillar instead of states.
485#pillarenv: None
486#
487# Set this option to 'True' to force a 'KeyError' to be raised whenever an
488# attempt to retrieve a named value from pillar fails. When this option is set
489# to 'False', the failed attempt returns an empty string. Default is 'False'.
490#pillar_raise_on_missing: False
491#
492# If using the local file directory, then the state top file name needs to be
493# defined, by default this is top.sls.
494#state_top: top.sls
495#
496# Run states when the minion daemon starts. To enable, set startup_states to:
497# 'highstate' -- Execute state.highstate
498# 'sls' -- Read in the sls_list option and execute the named sls files
499# 'top' -- Read top_file option and execute based on that file on the Master
500#startup_states: ''
501#
502# List of states to run when the minion starts up if startup_states is 'sls':
503#sls_list:
504# - edit.vim
505# - hyper
506#
507# Top file to execute if startup_states is 'top':
508#top_file: ''
509
510# Automatically aggregate all states that have support for mod_aggregate by
511# setting to True. Or pass a list of state module names to automatically
512# aggregate just those types.
513#
514# state_aggregate:
515# - pkg
516#
517#state_aggregate: False
518
519##### File Directory Settings #####
520##########################################
521# The Salt Minion can redirect all file server operations to a local directory,
522# this allows for the same state tree that is on the master to be used if
523# copied completely onto the minion. This is a literal copy of the settings on
524# the master but used to reference a local directory on the minion.
525
526# Set the file client. The client defaults to looking on the master server for
527# files, but can be directed to look at the local file directory setting
528# defined below by setting it to "local". Setting a local file_client runs the
529# minion in masterless mode.
530#file_client: remote
531
532# The file directory works on environments passed to the minion, each environment
533# can have multiple root directories, the subdirectories in the multiple file
534# roots cannot match, otherwise the downloaded files will not be able to be
535# reliably ensured. A base environment is required to house the top file.
536# Example:
537# file_roots:
538# base:
539# - /srv/salt/
540# dev:
541# - /srv/salt/dev/services
542# - /srv/salt/dev/states
543# prod:
544# - /srv/salt/prod/services
545# - /srv/salt/prod/states
546#
547#file_roots:
548# base:
549# - /srv/salt
550
551# Uncomment the line below if you do not want the file_server to follow
552# symlinks when walking the filesystem tree. This is set to True
553# by default. Currently this only applies to the default roots
554# fileserver_backend.
555#fileserver_followsymlinks: False
556#
557# Uncomment the line below if you do not want symlinks to be
558# treated as the files they are pointing to. By default this is set to
559# False. By uncommenting the line below, any detected symlink while listing
560# files on the Master will not be returned to the Minion.
561#fileserver_ignoresymlinks: True
562#
563# By default, the Salt fileserver recurses fully into all defined environments
564# to attempt to find files. To limit this behavior so that the fileserver only
565# traverses directories with SLS files and special Salt directories like _modules,
566# enable the option below. This might be useful for installations where a file root
567# has a very large number of files and performance is negatively impacted. Default
568# is False.
569#fileserver_limit_traversal: False
570
571# The hash_type is the hash to use when discovering the hash of a file on
572# the local fileserver. The default is md5, but sha1, sha224, sha256, sha384
573# and sha512 are also supported.
574#
575# WARNING: While md5 and sha1 are also supported, do not use it due to the high chance
576# of possible collisions and thus security breach.
577#
578# WARNING: While md5 is also supported, do not use it due to the high chance
579# of possible collisions and thus security breach.
580#
581# Warning: Prior to changing this value, the minion should be stopped and all
582# Salt caches should be cleared.
583#hash_type: sha256
584
585# The Salt pillar is searched for locally if file_client is set to local. If
586# this is the case, and pillar data is defined, then the pillar_roots need to
587# also be configured on the minion:
588#pillar_roots:
589# base:
590# - /srv/pillar
591
592# Set a hard-limit on the size of the files that can be pushed to the master.
593# It will be interpreted as megabytes. Default: 100
594#file_recv_max_size: 100
595#
596#
597###### Security settings #####
598###########################################
599# Enable "open mode", this mode still maintains encryption, but turns off
600# authentication, this is only intended for highly secure environments or for
601# the situation where your keys end up in a bad state. If you run in open mode
602# you do so at your own risk!
603#open_mode: False
604
605# Enable permissive access to the salt keys. This allows you to run the
606# master or minion as root, but have a non-root group be given access to
607# your pki_dir. To make the access explicit, root must belong to the group
608# you've given access to. This is potentially quite insecure.
609#permissive_pki_access: False
610
611# The state_verbose and state_output settings can be used to change the way
612# state system data is printed to the display. By default all data is printed.
613# The state_verbose setting can be set to True or False, when set to False
614# all data that has a result of True and no changes will be suppressed.
615#state_verbose: True
616
617# The state_output setting changes if the output is the full multi line
618# output for each changed state if set to 'full', but if set to 'terse'
619# the output will be shortened to a single line.
620#state_output: full
621
622# The state_output_diff setting changes whether or not the output from
623# successful states is returned. Useful when even the terse output of these
624# states is cluttering the logs. Set it to True to ignore them.
625#state_output_diff: False
626
627# The state_output_profile setting changes whether profile information
628# will be shown for each state run.
629#state_output_profile: True
630
631# Fingerprint of the master public key to validate the identity of your Salt master
632# before the initial key exchange. The master fingerprint can be found by running
633# "salt-key -f master.pub" on the Salt master.
634#master_finger: ''
635
636
637###### Thread settings #####
638###########################################
639# Disable multiprocessing support, by default when a minion receives a
640# publication a new process is spawned and the command is executed therein.
641#multiprocessing: True
642
643
644##### Logging settings #####
645##########################################
646# The location of the minion log file
647# The minion log can be sent to a regular file, local path name, or network
648# location. Remote logging works best when configured to use rsyslogd(8) (e.g.:
649# ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI
650# format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>
651#log_file: /var/log/salt/minion
652#log_file: file:///dev/log
653#log_file: udp://loghost:10514
654#
655#log_file: /var/log/salt/minion
656#key_logfile: /var/log/salt/key
657
658# The level of messages to send to the console.
659# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
660#
661# The following log levels are considered INSECURE and may log sensitive data:
662# ['garbage', 'trace', 'debug']
663#
664# Default: 'warning'
665#log_level: warning
666
667# The level of messages to send to the log file.
668# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
669# If using 'log_granular_levels' this must be set to the highest desired level.
670# Default: 'warning'
671#log_level_logfile:
672
673# The date and time format used in log messages. Allowed date/time formatting
674# can be seen here: http://docs.python.org/library/time.html#time.strftime
675#log_datefmt: '%H:%M:%S'
676#log_datefmt_logfile: '%Y-%m-%d %H:%M:%S'
677
678# The format of the console logging messages. Allowed formatting options can
679# be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
680#
681# Console log colors are specified by these additional formatters:
682#
683# %(colorlevel)s
684# %(colorname)s
685# %(colorprocess)s
686# %(colormsg)s
687#
688# Since it is desirable to include the surrounding brackets, '[' and ']', in
689# the coloring of the messages, these color formatters also include padding as
690# well. Color LogRecord attributes are only available for console logging.
691#
692#log_fmt_console: '%(colorlevel)s %(colormsg)s'
693#log_fmt_console: '[%(levelname)-8s] %(message)s'
694#
695#log_fmt_logfile: '%(asctime)s,%(msecs)03d [%(name)-17s][%(levelname)-8s] %(message)s'
696
697# This can be used to control logging levels more specificically. This
698# example sets the main salt library at the 'warning' level, but sets
699# 'salt.modules' to log at the 'debug' level:
700# log_granular_levels:
701# 'salt': 'warning'
702# 'salt.modules': 'debug'
703#
704#log_granular_levels: {}
705
706# To diagnose issues with minions disconnecting or missing returns, ZeroMQ
707# supports the use of monitor sockets to log connection events. This
708# feature requires ZeroMQ 4.0 or higher.
709#
710# To enable ZeroMQ monitor sockets, set 'zmq_monitor' to 'True' and log at a
711# debug level or higher.
712#
713# A sample log event is as follows:
714#
715# [DEBUG ] ZeroMQ event: {'endpoint': 'tcp://127.0.0.1:4505', 'event': 512,
716# 'value': 27, 'description': 'EVENT_DISCONNECTED'}
717#
718# All events logged will include the string 'ZeroMQ event'. A connection event
719# should be logged as the minion starts up and initially connects to the
720# master. If not, check for debug log level and that the necessary version of
721# ZeroMQ is installed.
722#
723#zmq_monitor: False
724
725###### Module configuration #####
726###########################################
727# Salt allows for modules to be passed arbitrary configuration data, any data
728# passed here in valid yaml format will be passed on to the salt minion modules
729# for use. It is STRONGLY recommended that a naming convention be used in which
730# the module name is followed by a . and then the value. Also, all top level
731# data must be applied via the yaml dict construct, some examples:
732#
733# You can specify that all modules should run in test mode:
734#test: True
735#
736# A simple value for the test module:
737#test.foo: foo
738#
739# A list for the test module:
740#test.bar: [baz,quo]
741#
742# A dict for the test module:
743#test.baz: {spam: sausage, cheese: bread}
744#
745#
746###### Update settings ######
747###########################################
748# Using the features in Esky, a salt minion can both run as a frozen app and
749# be updated on the fly. These options control how the update process
750# (saltutil.update()) behaves.
751#
752# The url for finding and downloading updates. Disabled by default.
753#update_url: False
754#
755# The list of services to restart after a successful update. Empty by default.
756#update_restart_services: []
757
758
759###### Keepalive settings ######
760############################################
761# ZeroMQ now includes support for configuring SO_KEEPALIVE if supported by
762# the OS. If connections between the minion and the master pass through
763# a state tracking device such as a firewall or VPN gateway, there is
764# the risk that it could tear down the connection the master and minion
765# without informing either party that their connection has been taken away.
766# Enabling TCP Keepalives prevents this from happening.
767
768# Overall state of TCP Keepalives, enable (1 or True), disable (0 or False)
769# or leave to the OS defaults (-1), on Linux, typically disabled. Default True, enabled.
770#tcp_keepalive: True
771
772# How long before the first keepalive should be sent in seconds. Default 300
773# to send the first keepalive after 5 minutes, OS default (-1) is typically 7200 seconds
774# on Linux see /proc/sys/net/ipv4/tcp_keepalive_time.
775#tcp_keepalive_idle: 300
776
777# How many lost probes are needed to consider the connection lost. Default -1
778# to use OS defaults, typically 9 on Linux, see /proc/sys/net/ipv4/tcp_keepalive_probes.
779#tcp_keepalive_cnt: -1
780
781# How often, in seconds, to send keepalives after the first one. Default -1 to
782# use OS defaults, typically 75 seconds on Linux, see
783# /proc/sys/net/ipv4/tcp_keepalive_intvl.
784#tcp_keepalive_intvl: -1
785
786
787###### Windows Software settings ######
788############################################
789# Location of the repository cache file on the master:
790#win_repo_cachefile: 'salt://win/repo/winrepo.p'
791
792
793###### Returner settings ######
794############################################
795# Which returner(s) will be used for minion's result:
796#return: mysql
797
798
799###### Miscellaneous settings ######
800############################################
801# Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch
802#event_match_type: startswith
diff --git a/meta-openstack/recipes-support/salt/files/roster b/meta-openstack/recipes-support/salt/files/roster
deleted file mode 100644
index e5a8318..0000000
--- a/meta-openstack/recipes-support/salt/files/roster
+++ /dev/null
@@ -1,9 +0,0 @@
1# Sample salt-ssh config file
2#web1:
3# host: 192.168.42.1 # The IP addr or DNS hostname
4# user: fred # Remote executions will be executed as user fred
5# passwd: foobarbaz # The password to use for login, if omitted, keys are used
6# sudo: True # Whether to sudo to root, not enabled by default
7#web2:
8# host: 192.168.42.2
9
diff --git a/meta-openstack/recipes-support/salt/files/salt-api b/meta-openstack/recipes-support/salt/files/salt-api
deleted file mode 100755
index 4b45bd2..0000000
--- a/meta-openstack/recipes-support/salt/files/salt-api
+++ /dev/null
@@ -1,110 +0,0 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: salt-api
4# Required-Start: $remote_fs $network
5# Required-Stop: $remote_fs $network
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: salt api control daemon
9# Description: This is a daemon that exposes an external API
10### END INIT INFO
11
12# Author: Michael Prokop <mika@debian.org>
13
14PATH=/sbin:/usr/sbin:/bin:/usr/bin
15DESC="salt api control daemon"
16NAME=salt-api
17DAEMON=/usr/bin/salt-api
18DAEMON_ARGS="-d"
19PIDFILE=/var/run/$NAME.pid
20SCRIPTNAME=/etc/init.d/$NAME
21
22# Exit if the package is not installed
23[ -x "$DAEMON" ] || exit 0
24
25# Read configuration variable file if it is present
26[ -r /etc/default/$NAME ] && . /etc/default/$NAME
27
28# Source function library.
29. /etc/init.d/functions
30
31do_start() {
32 # Return
33 # 0 if daemon has been started
34 # 1 if daemon was already running
35 # 2 if daemon could not be started
36 pid=$(pidof -x $DAEMON)
37 if [ -n "$pid" ] ; then
38 return 1
39 fi
40
41 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \
42 || return 2
43}
44
45do_stop() {
46 # Return
47 # 0 if daemon has been stopped
48 # 1 if daemon was already stopped
49 # 2 if daemon could not be stopped
50 # other if a failure occ
51 start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --pidfile $PIDFILE --name $NAME
52 RETVAL=$?
53 [ "$RETVAL" = 2 ] && return 2
54 rm -f $PIDFILE
55 return "$RETVAL"
56}
57
58case "$1" in
59 start)
60 [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME"
61 do_start
62 case "$?" in
63 0|1) [ "$VERBOSE" != no ] && echo OK ;;
64 2) [ "$VERBOSE" != no ] && echo FAILED ;;
65 esac
66 ;;
67 stop)
68 [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME"
69 do_stop
70 case "$?" in
71 0|1) [ "$VERBOSE" != no ] && echo OK ;;
72 2) [ "$VERBOSE" != no ] && echo FAILED ;;
73 esac
74 ;;
75 status)
76 pid=`pidof -x $DAEMON`
77 if [ -n "$pid" ]; then
78 echo "$NAME (pid $pid) is running ..."
79 else
80 echo "$NAME is stopped"
81 fi
82 ;;
83 #reload)
84 # not implemented
85 #;;
86 restart|force-reload)
87 echo "Restarting $DESC" "$NAME"
88 do_stop
89 case "$?" in
90 0|1)
91 do_start
92 case "$?" in
93 0) echo OK ;;
94 1) echo FAILED ;; # Old process is still running
95 *) echo FAILED ;; # Failed to start
96 esac
97 ;;
98 *)
99 # Failed to stop
100 echo FAILED
101 ;;
102 esac
103 ;;
104 *)
105 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
106 exit 3
107 ;;
108esac
109
110exit 0
diff --git a/meta-openstack/recipes-support/salt/files/salt-common.bash_completion b/meta-openstack/recipes-support/salt/files/salt-common.bash_completion
deleted file mode 100644
index a457f4d..0000000
--- a/meta-openstack/recipes-support/salt/files/salt-common.bash_completion
+++ /dev/null
@@ -1,332 +0,0 @@
1# written by David Pravec
2# - feel free to /msg alekibango on IRC if you want to talk about this file
3
4# TODO: check if --config|-c was used and use configured config file for queries
5# TODO: solve somehow completion for salt -G pythonversion:[tab]
6# (not sure what to do with lists)
7# TODO: --range[tab] -- how?
8# TODO: -E --exsel[tab] -- how?
9# TODO: --compound[tab] -- how?
10# TODO: use history to extract some words, esp. if ${cur} is empty
11# TODO: TEST EVERYTING a lot
12# TODO: cache results of some functions? where? how long?
13# TODO: is it ok to use '--timeout 2' ?
14
15
16_salt_get_grains(){
17 if [ "$1" = 'local' ] ; then
18 salt-call --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
19 else
20 salt '*' --timeout 2 --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
21 fi
22}
23
24_salt_get_grain_values(){
25 if [ "$1" = 'local' ] ; then
26 salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
27 else
28 salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
29 fi
30}
31
32
33_salt(){
34 local cur prev opts _salt_grains _salt_coms pprev ppprev
35 COMPREPLY=()
36 cur="${COMP_WORDS[COMP_CWORD]}"
37 prev="${COMP_WORDS[COMP_CWORD-1]}"
38 if [ ${COMP_CWORD} -gt 2 ]; then
39 pprev="${COMP_WORDS[COMP_CWORD-2]}"
40 fi
41 if [ ${COMP_CWORD} -gt 3 ]; then
42 ppprev="${COMP_WORDS[COMP_CWORD-3]}"
43 fi
44
45 opts="-h --help -d --doc --documentation --version --versions-report -c \
46 --config-dir= -v --verbose -t --timeout= -s --static -b --batch= \
47 --batch-size= -E --pcre -L --list -G --grain --grain-pcre -N \
48 --nodegroup -R --range -C --compound -X --exsel -I --pillar \
49 --return= -a --auth= --eauth= --extended-auth= -T --make-token -S \
50 --ipcidr --out=pprint --out=yaml --out=overstatestage --out=json \
51 --out=raw --out=highstate --out=key --out=txt --no-color --out-indent= "
52
53 if [[ "${cur}" == -* ]] ; then
54 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
55 return 0
56 fi
57
58 # 2 special cases for filling up grain values
59 case "${pprev}" in
60 -G|--grain|--grain-pcre)
61 if [ "${cur}" = ":" ]; then
62 COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" ))
63 return 0
64 fi
65 ;;
66 esac
67 case "${ppprev}" in
68 -G|--grain|--grain-pcre)
69 if [ "${prev}" = ":" ]; then
70 COMPREPLY=( $(compgen -W "`_salt_get_grain_values ${pprev}`" -- ${cur}) )
71 return 0
72 fi
73 ;;
74 esac
75
76 if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
77 cur=""
78 fi
79 if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
80 prev="${pprev}"
81 fi
82
83 case "${prev}" in
84
85 -c|--config)
86 COMPREPLY=($(compgen -f -- ${cur}))
87 return 0
88 ;;
89 salt)
90 COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur}))
91 return 0
92 ;;
93 -E|--pcre)
94 COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur}))
95 return 0
96 ;;
97 -G|--grain|--grain-pcre)
98 COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
99 return 0
100 ;;
101 -C|--compound)
102 COMPREPLY=() # TODO: finish this one? how?
103 return 0
104 ;;
105 -t|--timeout)
106 COMPREPLY=($( compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 60 90 120 180" -- ${cur}))
107 return 0
108 ;;
109 -b|--batch|--batch-size)
110 COMPREPLY=($(compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 50 60 70 80 90 100 120 150 200"))
111 return 0
112 ;;
113 -X|--exsel) # TODO: finish this one? how?
114 return 0
115 ;;
116 -N|--nodegroup)
117 MASTER_CONFIG='/etc/salt/master'
118 COMPREPLY=($(compgen -W "`awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG}`" -- ${cur}))
119 return 0
120 ;;
121 esac
122
123 _salt_coms="$(salt '*' --timeout 2 --out=txt -- sys.list_functions | sed 's/^.*\[//' | tr -d ",']" )"
124 all="${opts} ${_salt_coms}"
125 COMPREPLY=( $(compgen -W "${all}" -- ${cur}) )
126
127 return 0
128}
129
130complete -F _salt salt
131
132
133_saltkey(){
134 local cur prev opts prev pprev
135 COMPREPLY=()
136 cur="${COMP_WORDS[COMP_CWORD]}"
137 prev="${COMP_WORDS[COMP_CWORD-1]}"
138 opts="-c --config-dir= -h --help --version --versions-report -q --quiet \
139 -y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \
140 -l --list= -L --list-all -a --accept= -A --accept-all \
141 -r --reject= -R --reject-all -p --print= -P --print-all \
142 -d --delete= -D --delete-all -f --finger= -F --finger-all \
143 --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
144 --out=highstate --out=key --out=txt --no-color --out-indent= "
145 if [ ${COMP_CWORD} -gt 2 ]; then
146 pprev="${COMP_WORDS[COMP_CWORD-2]}"
147 fi
148 if [ ${COMP_CWORD} -gt 3 ]; then
149 ppprev="${COMP_WORDS[COMP_CWORD-3]}"
150 fi
151 if [[ "${cur}" == -* ]] ; then
152 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
153 return 0
154 fi
155
156 if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
157 cur=""
158 fi
159 if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
160 prev="${pprev}"
161 fi
162
163 case "${prev}" in
164 -a|--accept)
165 COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
166 return 0
167 ;;
168 -r|--reject)
169 COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color)" -- ${cur}))
170 return 0
171 ;;
172 -d|--delete)
173 COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color; salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
174 return 0
175 ;;
176 -c|--config)
177 COMPREPLY=($(compgen -f -- ${cur}))
178 return 0
179 ;;
180 --keysize)
181 COMPREPLY=($(compgen -W "2048 3072 4096 5120 6144" -- ${cur}))
182 return 0
183 ;;
184 --gen-keys)
185 return 0
186 ;;
187 --gen-keys-dir)
188 COMPREPLY=($(compgen -d -- ${cur}))
189 return 0
190 ;;
191 -p|--print)
192 COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color; salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
193 return 0
194 ;;
195 -l|--list)
196 COMPREPLY=($(compgen -W "pre un acc accepted unaccepted rej rejected all" -- ${cur}))
197 return 0
198 ;;
199 --accept-all)
200 return 0
201 ;;
202 esac
203 COMPREPLY=($(compgen -W "${opts} " -- ${cur}))
204 return 0
205}
206
207complete -F _saltkey salt-key
208
209_saltcall(){
210 local cur prev opts _salt_coms pprev ppprev
211 COMPREPLY=()
212 cur="${COMP_WORDS[COMP_CWORD]}"
213 prev="${COMP_WORDS[COMP_CWORD-1]}"
214 opts="-h --help -d --doc --documentation --version --versions-report \
215 -m --module-dirs= -g --grains --return= --local -c --config-dir= -l --log-level= \
216 --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
217 --out=highstate --out=key --out=txt --no-color --out-indent= "
218 if [ ${COMP_CWORD} -gt 2 ]; then
219 pprev="${COMP_WORDS[COMP_CWORD-2]}"
220 fi
221 if [ ${COMP_CWORD} -gt 3 ]; then
222 ppprev="${COMP_WORDS[COMP_CWORD-3]}"
223 fi
224 if [[ "${cur}" == -* ]] ; then
225 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
226 return 0
227 fi
228
229 if [ "${cur}" = "=" ] && [[ ${prev} == --* ]]; then
230 cur=""
231 fi
232 if [ "${prev}" = "=" ] && [[ ${pprev} == --* ]]; then
233 prev="${pprev}"
234 fi
235
236 case ${prev} in
237 -m|--module-dirs)
238 COMPREPLY=( $(compgen -d ${cur} ))
239 return 0
240 ;;
241 -l|--log-level)
242 COMPREPLY=( $(compgen -W "info none garbage trace warning error debug" -- ${cur}))
243 return 0
244 ;;
245 -g|grains)
246 return 0
247 ;;
248 salt-call)
249 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
250 return 0
251 ;;
252 esac
253
254 _salt_coms="$(salt-call --out=txt -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )"
255 COMPREPLY=( $(compgen -W "${opts} ${_salt_coms}" -- ${cur} ))
256 return 0
257}
258
259complete -F _saltcall salt-call
260
261
262_saltcp(){
263 local cur prev opts target prefpart postpart helper filt pprev ppprev
264 COMPREPLY=()
265 cur="${COMP_WORDS[COMP_CWORD]}"
266 prev="${COMP_WORDS[COMP_CWORD-1]}"
267 opts="-t --timeout= -s --static -b --batch= --batch-size= \
268 -h --help --version --versions-report -c --config-dir= \
269 -E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \
270 -R --range -C --compound -X --exsel -I --pillar \
271 --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
272 --out=highstate --out=key --out=txt --no-color --out-indent= "
273 if [[ "${cur}" == -* ]] ; then
274 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
275 return 0
276 fi
277
278 if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
279 cur=""
280 fi
281 if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
282 prev=${pprev}
283 fi
284
285 case ${prev} in
286 salt-cp)
287 COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur}))
288 return 0
289 ;;
290 -t|--timeout)
291 # those numbers are just a hint
292 COMPREPLY=($(compgen -W "2 3 4 8 10 15 20 25 30 40 60 90 120 180 240 300" -- ${cur} ))
293 return 0
294 ;;
295 -E|--pcre)
296 COMPREPLY=($(compgen -W "`salt-key -l acc --no-color`" -- ${cur}))
297 return 0
298 ;;
299 -L|--list)
300 # IMPROVEMENTS ARE WELCOME
301 prefpart="${cur%,*},"
302 postpart=${cur##*,}
303 filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$"
304 helper=($(salt-key -l acc --no-color | grep -v "${filt}" | sed "s/^/${prefpart}/"))
305 COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur}))
306
307 return 0
308 ;;
309 -G|--grain|--grain-pcre)
310 COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
311 return 0
312 ;;
313 # FIXME
314 -R|--range)
315 # FIXME ??
316 return 0
317 ;;
318 -C|--compound)
319 # FIXME ??
320 return 0
321 ;;
322 -c|--config)
323 COMPREPLY=($(compgen -f -- ${cur}))
324 return 0
325 ;;
326 esac
327
328 # default is using opts:
329 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
330}
331
332complete -F _saltcp salt-cp
diff --git a/meta-openstack/recipes-support/salt/files/salt-common.logrotate b/meta-openstack/recipes-support/salt/files/salt-common.logrotate
deleted file mode 100644
index 3cd0023..0000000
--- a/meta-openstack/recipes-support/salt/files/salt-common.logrotate
+++ /dev/null
@@ -1,23 +0,0 @@
1/var/log/salt/master {
2 weekly
3 missingok
4 rotate 7
5 compress
6 notifempty
7}
8
9/var/log/salt/minion {
10 weekly
11 missingok
12 rotate 7
13 compress
14 notifempty
15}
16
17/var/log/salt/key {
18 weekly
19 missingok
20 rotate 7
21 compress
22 notifempty
23}
diff --git a/meta-openstack/recipes-support/salt/files/salt-master b/meta-openstack/recipes-support/salt/files/salt-master
deleted file mode 100755
index b534b36..0000000
--- a/meta-openstack/recipes-support/salt/files/salt-master
+++ /dev/null
@@ -1,111 +0,0 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: salt-master
4# Required-Start: $remote_fs $network
5# Required-Stop: $remote_fs $network
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: salt master control daemon
9# Description: This is a daemon that controls the salt minions
10### END INIT INFO
11
12# Author: Michael Prokop <mika@debian.org>
13
14PATH=/sbin:/usr/sbin:/bin:/usr/bin
15DESC="salt master control daemon"
16NAME=salt-master
17DAEMON=/usr/bin/salt-master
18DAEMON_ARGS="-d"
19PIDFILE=/var/run/$NAME.pid
20SCRIPTNAME=/etc/init.d/$NAME
21
22# Exit if the package is not installed
23[ -x "$DAEMON" ] || exit 0
24
25# Read configuration variable file if it is present
26[ -r /etc/default/$NAME ] && . /etc/default/$NAME
27
28# Source function library.
29. /etc/init.d/functions
30
31do_start() {
32 # Return
33 # 0 if daemon has been started
34 # 1 if daemon was already running
35 # 2 if daemon could not be started
36 pid=$(pidof -x $DAEMON)
37 if [ -n "$pid" ] ; then
38 return 1
39 fi
40
41 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
42 $DAEMON_ARGS \
43 || return 2
44}
45
46do_stop() {
47 # Return
48 # 0 if daemon has been stopped
49 # 1 if daemon was already stopped
50 # 2 if daemon could not be stopped
51 # other if a failure occurred
52 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
53 RETVAL="$?"
54 [ "$RETVAL" = 2 ] && return 2
55 rm -f $PIDFILE
56 return "$RETVAL"
57}
58
59case "$1" in
60 start)
61 [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME"
62 do_start
63 case "$?" in
64 0|1) [ "$VERBOSE" != no ] && echo OK ;;
65 2) [ "$VERBOSE" != no ] && echo FAILED ;;
66 esac
67 ;;
68 stop)
69 [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME"
70 do_stop
71 case "$?" in
72 0|1) [ "$VERBOSE" != no ] && echo OK ;;
73 2) [ "$VERBOSE" != no ] && echo FAILED ;;
74 esac
75 ;;
76 status)
77 pid=`pidof -x $DAEMON`
78 if [ -n "$pid" ]; then
79 echo "$NAME (pid $pid) is running ..."
80 else
81 echo "$NAME is stopped"
82 fi
83 ;;
84 #reload)
85 # not implemented
86 #;;
87 restart|force-reload)
88 echo "Restarting $DESC" "$NAME"
89 do_stop
90 case "$?" in
91 0|1)
92 do_start
93 case "$?" in
94 0) echo OK ;;
95 1) echo FAILED ;; # Old process is still running
96 *) echo FAILED ;; # Failed to start
97 esac
98 ;;
99 *)
100 # Failed to stop
101 echo FAILED
102 ;;
103 esac
104 ;;
105 *)
106 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
107 exit 3
108 ;;
109esac
110
111exit 0
diff --git a/meta-openstack/recipes-support/salt/files/salt-minion b/meta-openstack/recipes-support/salt/files/salt-minion
deleted file mode 100755
index e062017..0000000
--- a/meta-openstack/recipes-support/salt/files/salt-minion
+++ /dev/null
@@ -1,111 +0,0 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: salt-minion
4# Required-Start: $remote_fs $network
5# Required-Stop: $remote_fs $network
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: salt minion control daemon
9# Description: This is a daemon that receives commands from a salt-master
10### END INIT INFO
11
12# Author: Michael Prokop <mika@debian.org>
13
14PATH=/sbin:/usr/sbin:/bin:/usr/bin
15DESC="salt minion control daemon"
16NAME=salt-minion
17DAEMON=/usr/bin/salt-minion
18DAEMON_ARGS="-d"
19PIDFILE=/var/run/$NAME.pid
20SCRIPTNAME=/etc/init.d/$NAME
21
22# Exit if the package is not installed
23[ -x "$DAEMON" ] || exit 0
24
25# Read configuration variable file if it is present
26[ -r /etc/default/$NAME ] && . /etc/default/$NAME
27
28# Source function library.
29. /etc/init.d/functions
30
31do_start() {
32 # Return
33 # 0 if daemon has been started
34 # 1 if daemon was already running
35 # 2 if daemon could not be started
36 pid=$(pidof -x $DAEMON)
37 if [ -n "$pid" ] ; then
38 return 1
39 fi
40
41 start-stop-daemon --start --quiet --background --pidfile $PIDFILE --exec $DAEMON -- \
42 $DAEMON_ARGS \
43 || return 2
44}
45
46do_stop() {
47 # Return
48 # 0 if daemon has been stopped
49 # 1 if daemon was already stopped
50 # 2 if daemon could not be stopped
51 # other if a failure occurred
52 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
53 RETVAL="$?"
54 [ "$RETVAL" = 2 ] && return 2
55 rm -f $PIDFILE
56 return "$RETVAL"
57}
58
59case "$1" in
60 start)
61 [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME"
62 do_start
63 case "$?" in
64 0|1) [ "$VERBOSE" != no ] && echo OK ;;
65 2) [ "$VERBOSE" != no ] && echo FAILED ;;
66 esac
67 ;;
68 stop)
69 [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME"
70 do_stop
71 case "$?" in
72 0|1) [ "$VERBOSE" != no ] && echo OK ;;
73 2) [ "$VERBOSE" != no ] && echo FAILED ;;
74 esac
75 ;;
76 status)
77 pid=`pidof -x $DAEMON`
78 if [ -n "$pid" ]; then
79 echo "$NAME (pid $pid) is running ..."
80 else
81 echo "$NAME is stopped"
82 fi
83 ;;
84 #reload)
85 # not implemented
86 #;;
87 restart|force-reload)
88 echo "Restarting $DESC" "$NAME"
89 do_stop
90 case "$?" in
91 0|1)
92 do_start
93 case "$?" in
94 0) echo OK ;;
95 1) echo FAILED ;; # Old process is still running
96 *) echo FAILED ;; # Failed to start
97 esac
98 ;;
99 *)
100 # Failed to stop
101 echo FAILED
102 ;;
103 esac
104 ;;
105 *)
106 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
107 exit 3
108 ;;
109esac
110
111exit 0
diff --git a/meta-openstack/recipes-support/salt/files/salt-syndic b/meta-openstack/recipes-support/salt/files/salt-syndic
deleted file mode 100755
index 6d5cdff..0000000
--- a/meta-openstack/recipes-support/salt/files/salt-syndic
+++ /dev/null
@@ -1,111 +0,0 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: salt-syndic
4# Required-Start: $remote_fs $network
5# Required-Stop: $remote_fs $network
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: salt syndic control daemon
9# Description: This is a daemon for the master of masters
10### END INIT INFO
11
12# Author: Michael Prokop <mika@debian.org>
13
14PATH=/sbin:/usr/sbin:/bin:/usr/bin
15DESC="salt syndic control daemon"
16NAME=salt-syndic
17DAEMON=/usr/bin/salt-syndic
18DAEMON_ARGS="-d"
19PIDFILE=/var/run/$NAME.pid
20SCRIPTNAME=/etc/init.d/$NAME
21
22# Exit if the package is not installed
23[ -x "$DAEMON" ] || exit 0
24
25# Read configuration variable file if it is present
26[ -r /etc/default/$NAME ] && . /etc/default/$NAME
27
28# Source function library.
29. /etc/init.d/functions
30
31do_start() {
32 # Return
33 # 0 if daemon has been started
34 # 1 if daemon was already running
35 # 2 if daemon could not be started
36 pid=$(pidof -x $DAEMON)
37 if [ -n "$pid" ] ; then
38 return 1
39 fi
40
41 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
42 $DAEMON_ARGS \
43 || return 2
44}
45
46do_stop() {
47 # Return
48 # 0 if daemon has been stopped
49 # 1 if daemon was already stopped
50 # 2 if daemon could not be stopped
51 # other if a failure occurred
52 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
53 RETVAL="$?"
54 [ "$RETVAL" = 2 ] && return 2
55 rm -f $PIDFILE
56 return "$RETVAL"
57}
58
59case "$1" in
60 start)
61 [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME"
62 do_start
63 case "$?" in
64 0|1) [ "$VERBOSE" != no ] && echo OK ;;
65 2) [ "$VERBOSE" != no ] && echo FAILED ;;
66 esac
67 ;;
68 stop)
69 [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME"
70 do_stop
71 case "$?" in
72 0|1) [ "$VERBOSE" != no ] && echo OK ;;
73 2) [ "$VERBOSE" != no ] && echo FAILED ;;
74 esac
75 ;;
76 status)
77 pid=`pidof -x $DAEMON`
78 if [ -n "$pid" ]; then
79 echo "$NAME (pid $pid) is running ..."
80 else
81 echo "$NAME is stopped"
82 fi
83 ;;
84 #reload)
85 # not implemented
86 #;;
87 restart|force-reload)
88 echo "Restarting $DESC" "$NAME"
89 do_stop
90 case "$?" in
91 0|1)
92 do_start
93 case "$?" in
94 0) echo OK ;;
95 1) echo FAILED ;; # Old process is still running
96 *) echo FAILED ;; # Failed to start
97 esac
98 ;;
99 *)
100 # Failed to stop
101 echo FAILED
102 ;;
103 esac
104 ;;
105 *)
106 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
107 exit 3
108 ;;
109esac
110
111exit 0