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
0
votes
1 answer

python string iterpolation on files with % as comment

I would like to use fabric to generate a custom ejabberd config file and upload to server. fabric uses python string interpolation in fabric.contrib.files.upload_template. Unfortunately ejabberd config file uses %%% for comments Using python…
jassinm
  • 7,323
  • 3
  • 33
  • 42
0
votes
2 answers

Use Fabric's to get a shell with context managers like 'prefix' and 'cd' applied?

How can I get an interactive shell that's aware of any of Fabric's context managers that have been applied? For example, I'd expect that this would open a shell in /tmp/ with a virtualenv active: with cd("/tmp/"): with prefix("source…
David Wolever
  • 148,955
  • 89
  • 346
  • 502
0
votes
2 answers

How can I log into a firewall first before running fabric commands?

I'm trying to get running a deployment file in fabric, but our appservers have a firewall before the actual servers that needs to be logged into first. How can i make fabric log into that first? i haven't been able to find and documentation on this…
user922592
0
votes
2 answers

Fabric: Run command as root automatically

I have some freebsd servers and don't have sudo. But I want to run some command automatically with root just like the following command: def autodeploy(url): with cd('/tmp'): if not exists('releasetar.sh'): …
zjhui
  • 779
  • 1
  • 8
  • 21
0
votes
1 answer

modifying apache ports.conf via fabric script

I am automating the deploy of a site that requires me to add a listen port to ports.conf. Right now it is ok for me to just replace the existing one but as new sites get added I would like to be able to just modify the file. I have seen examples of…
RockyMountainHigh
  • 2,871
  • 5
  • 34
  • 68
0
votes
1 answer

Unable to identify the host : Fabric

I m trying to use fabric module through simple python module remoteExc.py from fabric.api import * def clone_repo(IPADDRESS,USER,fPath,git_url): env.hosts_string = IPADDRESS env.user = USER env.key_filename = fPath env.disable_known_hosts =…
naga4ce
  • 1,527
  • 3
  • 17
  • 21
0
votes
1 answer

Why does PIP install of python-couchdb experimental branch from SVN fail?

I'm setting up a Fabric/virtualenv/pip automated deployment for a project and I need to install the latest experimental branch of python-couchdb. Naturally, I stick it in my pip requirements file, like so: -e…
bouvard
  • 3,864
  • 25
  • 29
0
votes
1 answer

Fabric -f option not working

I've been using Fabric successfully from my local machine for a while now and finally have a decent deploy script that I'd like to call during a post-receive hook for git. In order to accomplish this I have the following code, all of which is…
Chris Pfohl
  • 18,220
  • 9
  • 68
  • 111
0
votes
1 answer

Detach program from SSH connection on a windows

I need to log in to a Windows server via SSH through a local Python (2.7) script, start a script on the server and then disconnect the SSH connection, so that the local script can continue to run. As of now, I am using fabric, and the local script…
0
votes
2 answers

`which` finds file, but `bash` doesn't

I installed Fabric via pip. Got pip by: sudo apt-get install python-pip Got fabric by: sudo pip install fabric (It failed when I tried w/out sudo, and warns me about a lack of files in docs or tests). Now I get the following: $ which…
Chris Pfohl
  • 18,220
  • 9
  • 68
  • 111
0
votes
1 answer

Python Fabric config file (~/.fabricrc) is not used

I'm developing a task where I need to have a few pieces of information specific to the environment. I setup the ~/.fabricrc file but when I run the task via command line, the data is not in the env variable I don't really want to add the -c config…
Clutch
  • 7,404
  • 11
  • 45
  • 56
0
votes
2 answers

How to get version number when using Chef to deploy application

I am using Jenkins to build the application in the testing server, after that, jenkins executes a fabric script in which a chef script will be executed in the production server. In the chef script, first i have to get the jar to be deployed from…
Foredoomed
  • 2,219
  • 2
  • 21
  • 39
0
votes
1 answer

fabric: dealing with cd() in helper functions

In fabric, the cd context manager works like with cd("dir"): run("command") and the command will be run after changing to the dir directory. This works fine, but the issue is that it uses a global state. For example, suppose I have a helper…
asmeurer
  • 86,894
  • 26
  • 169
  • 240
0
votes
2 answers

How to use the default pip to install python packges to a specific virtualenv

How to use pip to install software to a specific virtualenv from outside the virtualenv. For example if I have a virtualenv /home/guest/virtualenv/django-env, How to install python packages into…
binithb
  • 1,910
  • 4
  • 23
  • 44
0
votes
1 answer

Can Fabric display Yum or apt-get progress sliders correctly?

If you run run('yum upgrade') You'll see that the progress slider is repeated on screen, that is, every time it increments, a new line appears on screen unlike what you see in a 'real' ssh session (where the slider just increments to 100% on a…
Stephan Tual
  • 2,617
  • 3
  • 27
  • 49