Questions tagged [fabric]

A Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. For questions about Google Fabric service, please use the tag [google-fabric]. For questions about FabricJs library, please use [fabricjs]. For questions about Hyperledger Fabric, please use [hyperledger-fabric]. For questions about the Minecraft modding toolchain Fabric, please use [minecraft-fabric].

Fabric provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.

Typical use involves creating a Python module containing one or more functions, then executing them via the fab command-line tool.

1531 questions
42
votes
8 answers

fabric password

Every time fabric runs, it asks for root password, can it be sent along same for automated proposes. fab staging test
bocca
  • 1,887
  • 4
  • 20
  • 24
37
votes
3 answers

Best Fabric scripts for Django

What are the best stock Fabric scripts for deploying a typical Django project? Fabric looks very good, but seems to require you to start from scratch and write your own deployment script. Coming from Capistrano, I'd like to start with something…
Lee
  • 2,539
  • 3
  • 19
  • 8
36
votes
1 answer

Fabric's cd context manager does not work

I have set up my development environment on a new PC and seems I am having strange error with Fabric. Its 'cd' context manager seems does not change the current directory, and thus a lot of my commands don't work. I have written the test and it…
Serge Tarkovski
  • 1,861
  • 6
  • 19
  • 24
35
votes
6 answers

Easy way to suppress output of fabric run?

I am running a command on the remote machine: remote_output = run('mysqldump --no-data --user=username --password={0} database'.format(password)) I would like to capture the output, but not have it all printed to the screen. What's the easiest way…
Ben McCann
  • 18,548
  • 25
  • 83
  • 101
33
votes
6 answers

Fabric - Is there any way to capture run stdout?

I'm trying to do the following: output = run("ls -l backups") for line in output.split("/n"): do_stuff(line) Any way of having the stdout of ls sent to output? To be more specific I'm using a CLI app called s3cmd which does something similar…
RadiantHex
  • 24,907
  • 47
  • 148
  • 244
33
votes
4 answers

Is there a deployment tool similar to Fabric written in JavaScript?

I put together a mobile development stack that is almost entirely using Javascript on node.js. With the only exception of SASS (prefer it to LESS) and Fabric. I prefer not to pollute my development directory and as I have to combine and minify JS…
Peter Throwson
  • 405
  • 2
  • 5
  • 7
32
votes
1 answer

when to use fabric or ansible?

OVERVIEW I'd like to have reliable django deployments and I think I'm not following the best practices here. Till now I've been using fabric as a configuration management tool in order to deploy my django sites but I'm not sure that's the best way…
BPL
  • 9,632
  • 9
  • 59
  • 117
32
votes
6 answers

How to answer to prompts automatically with python fabric?

I want to run a command which prompts me to enter yes/no or y/n or whatever. If I just run the command local("my_command") then it stops and asks me for input. When I type what is needed, script continues to work. How can I automatically respond to…
aemdy
  • 3,702
  • 6
  • 34
  • 49
31
votes
2 answers

How to ForwardAgent yes using fabric?

I am successfully run()ning commands on remote server with my private key pair. However, I'd like to do git clone ssh://private/repo on remote server using my local key (or using local ssh agent I'm in). How to do it using fabric?
Almad
  • 5,753
  • 7
  • 35
  • 53
31
votes
4 answers

Can a Python Fabric task invoke other tasks and respect their hosts lists?

I have a fabfile like the following: @hosts('host1') def host1_deploy(): """Some logic that is specific to deploying to host1""" @hosts('host2') def host2_deploy(): """Some logic that is specific to deploying to host2""" def deploy(): …
fabricquestion
  • 311
  • 3
  • 3
29
votes
10 answers

How to start a background process with nohup using Fabric?

Through Fabric, I am trying to start a celerycam process using the below nohup command. Unfortunately, nothing is happening. Manually using the same command, I could start the process but not through Fabric. Any advice on how can I solve this? def…
Mo J. Mughrabi
  • 6,747
  • 16
  • 85
  • 143
29
votes
3 answers

Fabric vs Invoke

I have been using fabric and recently got told about invoke, so I took a look at it's documentation: Like Ruby’s Rake tool and Invoke’s own predecessor Fabric 1.x, it provides a clean, high level API for running shell commands and …
James Lin
  • 25,028
  • 36
  • 133
  • 233
28
votes
3 answers

Connecting to EC2 using keypair (.pem file) via Fabric

Anyone has any Fabric recipe that shows how to connect to EC2 using the pem file? I tried writing it with this manner: Python Fabric run command returns "binascii.Error: Incorrect padding" But I'm faced with some encoding issue, when I execute the…
Mickey Cheong
  • 2,980
  • 6
  • 38
  • 50
28
votes
2 answers

How to set the working directory for a Fabric task?

Assuming I define a trivial task to list files on a remote server: from fabric.api import run, env env.use_ssh_config = True def list_files(): run('ls') And I execute it with: fab -H server list_files How can I specify the working directory…
Roberto Aloi
  • 30,570
  • 21
  • 75
  • 112
27
votes
1 answer

How to set CFLAGS and LDFLAGS to compile pycrypto

I am trying to install the fabric library to an old machine. There are some legacy libraries in /usr/lib, such as libgmp. (py27)[qrtt1@hcservice app]$ ls /usr/lib|grep…
qrtt1
  • 7,746
  • 8
  • 42
  • 62