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.

--abort-on-prompts —
sets env.abort_on_prompts to True, forcing Fabric to abort whenever it
would prompt for input.

-c RCFILE, --config=RCFILE
— sets env.rcfile to the given file path, which Fabric will try to load
on startup and use to update environment variables.

-d COMMAND, --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.)

--connection-attempts=M, -n M
— sets the number of times to attempt connections. Sets
env.connection_attempts.

-f FABFILE, --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).

-F LIST_FORMAT,
--list-format=LIST_FORMAT —
allows control over the output format of --list.
short is equivalent to
--shortlist; normal is the same as simply omitting this option entirely
(the default), and nested prints out a nested namespace tree.

-g HOST, --gateway=HOST
— sets env.gateway to HOST host string.

-h, --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.

-x HOSTS,
--exclude-hosts=HOSTS —
sets env.exclude_hosts to 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) env.key_filename.

-I, --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
--password or by setting
env.password in your fabfile is undesirable.

-k —
sets env.no_keys to True, forcing the SSH layer not to look for SSH
private key files in one's home directory.

--linewise —
forces output to be buffered line by line instead of byte by byte.
Often useful or required for parallel execution.

-l, --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).

-p PASSWORD,
--password=PASSWORD —
sets env.password to the given string; it then will be used as the
default password when making SSH connections or calling the sudo program.

-P, --parallel —
sets env.parallel to True, causing tasks to run in parallel.

--no-pty —
sets env.always_use_pty to False, causing all run/sudo calls to behave
as if one had specified pty=False.

-r, --reject-unknown-hosts
—
sets env.reject_unknown_hosts to True, causing Fabric to abort when
connecting to hosts not found in the user's SSH known_hosts file.

-R ROLES, --roles=ROLES
—
sets env.roles to 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.

-s SHELL, --shell=SHELL
— sets env.shell to 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.

I've started using 'Salt' for this purpose. It handles all the rsa key authentication automatically, allows for remote execution of scripts, and also, offers a higher level configuration management system.http://saltstack.com/community.html

Geek Guides

Pick up any e-commerce web or mobile app today, and you’ll be holding a mashup of interconnected applications and services from a variety of different providers. For instance, when you connect to Amazon’s e-commerce app, cookies, tags and pixels that are monitored by solutions like Exact Target, BazaarVoice, Bing, Shopzilla, Liveramp and Google Tag Manager track every action you take. You’re presented with special offers and coupons based on your viewing and buying patterns. If you find something you want for your birthday, a third party manages your wish list, which you can share through multiple social- media outlets or email to a friend. When you select something to buy, you find yourself presented with similar items as kind suggestions. And when you finally check out, you’re offered the ability to pay with promo codes, gifts cards, PayPal or a variety of credit cards.