slack - Sysadmin's lazy autoconfiguration kit
] [role ...
slack is a master command which coordinates the activities of its backends,
- determine the list of roles to be installed on this
- create a local cached copy of the role files from the
- merge file trees from subroles into a single, unified
- install files onto the local filesystem
- run scripts before and after installation
Options you give to slack will be generally passed along to the backends where
- -h, --help
- Print a usage statement.
- Print the version and exit.
- -v, --verbose
- Increase verbosity. Can be specified multiple times.
- Don't be verbose (Overrides previous uses of
- -C, --config FILE
- Use the specfied FILE for configuration instead of the
- -s, --source DIR
- Source directory for slack files
- -e, --rsh COMMAND
- Remote shell for rsync
- -c, --cache DIR
- Local cache directory for slack files
- -t, --stage DIR
- Local staging directory for slack files
- -r, --root DIR
- Root destination for slack files
- Skip the slack-sync step (useful if you're pushing stuff
into the CACHE outside slack).
- Don't install any files in ROOT, but tell rsync to print
what it would do.
- Don't run scripts
- -n, --dry-run
- Same as --no-files --no-scripts (CACHE, STAGE will still be
- Role list for slack-getroles(8).
- -b, --backup
- Make backups of existing files in ROOT that are
overwritten. This option defaults to on if it is not set to 0 in a config
file or disabled with --nobackup on the command line.
- Put backups from the --backup option into this
- -H, --hostname HOST
- Pretend to be running on HOST, instead of the name given by
- --preview MODE
- Do a diff of scripts and files before running them. MODE
can be one of 'simple' or 'prompt' (See PREVIEW MODES, below).
- --diff PROG
- Use this diff program for previews.
- --sleep TIME
- Randomly sleep between 1 and TIME seconds before starting
operations. Useful in crontabs.
Preview functionality is new in slack 0.14.0. I haven't quite worked out how
things will work, so this usage is somewhat subject to change in future
versions. I thought I would try it this way and see how people like it.
In 'simple' mode, after syncing and staging the files directory, slack will
present a diff of the files and scripts. In this mode, slack will not run the
preinstall or fixfiles scripts, and because of this, it may provide some false
output about permissions changes to files.
In 'prompt' mode, after syncing and staging the files directory, slack will diff
the script directory. If there are differences, slack will present them to you
and ask you if you want to continue. If you say no, it will exit. If you say
yes, it will stage the scripts directory, run the preinstall and fixfiles
scripts, and then diff the files in the stage with those in the root. If there
are differences, slack will present them to you and ask you if you want to
continue. If you say no, it will exit. If you say yes, it will install the
files and run the postinstall script.
So, the 'simple' mode is easy to use, and will be accurate if you don't use
fixfiles. The 'prompt' mode will be accurate if you use fixfiles, but requires
Why can't we just have one mode that works with fixfiles and requires no
interaction? Well, that would require slack to understand what your free-form
fixfiles executable was going to do, which would either require some kind of
universe simulator or would require you to write your fixfiles in a less
free-form way, which would make slack less like slack.
To install all the roles configured in the role list for a server:
To install a specific role:
To test a new role before checking in the changes:
To avoid killing your master server when calling from cron:
slack --sleep 3600