Fabric: a System Administrator's Best Friend
A Brief Word on Application Deployment
Fabric also is used in development teams to deploy new code to production. It is actually used in a fairly similar fashion to how system administrators use it (copy files, run a few commands and so on), just in a very specific manner. Because of how automated Fabric is, it's easy to incorporate it into a continuous integration cycle and even fully automate your deployment process.
env.no_agentto True, forcing your SSH layer not to talk to the SSH agent when trying to unlock private key files.
env.forward_agentto True, enabling agent forwarding.
env.abort_on_promptsto True, forcing Fabric to abort whenever it would prompt for input.
env.rcfileto the given file path, which Fabric will try to load on startup and use to update environment variables.
--display=COMMAND— prints the entire docstring for the given task, if there is one. It does not currently print out the task's function signature, so descriptive docstrings are a good idea. (They're always a good idea, of course, just more so here.)
-n M— sets the number of times to attempt connections. Sets
env.disable_known_hoststo True, preventing Fabric from loading the user's SSH known_hosts file.
--fabfile=FABFILE— the fabfile name pattern to search for (defaults to fabfile.py), or alternately an explicit file path to load as the fabfile (for example, /path/to/my/fabfile.py).
--list-format=LIST_FORMAT— allows control over the output format of
shortis equivalent to
normalis the same as simply omitting this option entirely (the default), and
nestedprints out a nested namespace tree.
env.gatewayto HOST host string.
--help— displays a standard help message with all possible options and a brief overview of what they do, then exits.
--hide=LEVELS— a comma-separated list of output levels to hide by default.
env.hoststo the given comma-delimited list of host strings.
env.exclude_hoststo the given comma-delimited list of host strings to keep out of the final host list.
-i KEY_FILENAME— when set to a file path, will load the given file as an SSH identity file (usually a private key). This option may be repeated multiple times. Sets (or appends to)
--initial-password-prompt— forces a password prompt at the start of the session (after fabfile load and option parsing, but before executing any tasks) in order to pre-fill
env.password. This is useful for fire-and-forget runs (especially parallel sessions, in which runtime input is not possible) when setting the password via
--passwordor by setting
env.passwordin your fabfile is undesirable.
env.no_keysto True, forcing the SSH layer not to look for SSH private key files in one's home directory.
env.keepaliveto the given (integer) value, specifying an SSH keepalive interval.
--linewise— forces output to be buffered line by line instead of byte by byte. Often useful or required for parallel execution.
--list— imports a fabfile as normal, but then prints a list of all discovered tasks and exits. Will also print the first line of each task's docstring, if it has one, next to it (truncating if necessary).
env.passwordto the given string; it then will be used as the default password when making SSH connections or calling the sudo program.
env.parallelto True, causing tasks to run in parallel.
env.always_use_ptyto False, causing all run/sudo calls to behave as if one had specified
env.reject_unknown_hoststo True, causing Fabric to abort when connecting to hosts not found in the user's SSH known_hosts file.
env.rolesto the given comma-separated list of role names.
--set KEY=VALUE,...— allows you to set default values for arbitrary Fabric env vars. Values set this way have a low precedence. They will not override more specific env vars that also are specified on the command line.
env.shellto the given string, overriding the default shell wrapper used to execute remote commands.
--shortlist— similar to
--list, but without any embellishment—just task names separated by newlines with no indentation or docstrings.
--show=LEVELS— a comma-separated list of output levels to be added to those that are shown by default.
env.skip_bad_hosts, causing Fabric to skip unavailable hosts.
-t N— set connection timeout in seconds. Sets
env.userto the given string; it then will be used as the default user name when making SSH connections.
--version— displays Fabric's version number, then exits.
env.warn_onlyto True, causing Fabric to continue execution even when commands encounter error conditions.
env.pool_size, which specifies how many processes to run concurrently during parallel execution.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- SUSE LLC's SUSE Manager
- Managing Linux Using Puppet
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
- Doing for User Space What We Did for Kernel Space
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide