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

fabric assign unique index to each task

I'm using fabric to run some tests, each test on each machine. I want to pass a unique index to each run invocation. When not allow duplicate hosts, I'm doing something like: @task @parallel def run_test(): idx = env.hosts.index(env.host) …
eran
  • 6,731
  • 6
  • 35
  • 52
0
votes
1 answer

How to start tomcat by Fabric with sudo as another user?

My ubuntu server is login server by ssh key and user is ubuntu. and tomcat user is tomcat and it's password is tomcat. I want to start tomcat by Fabric. and my method is like this, login in user is ubuntu, and want to su user tomcat; but i had a…
Reilost
  • 56
  • 2
0
votes
2 answers

Fabric does not handle env.key_filename properly

I am running Fabric 1.6.0 (paramiko 1.10.1). I have the following script: from fabric.api import env, output, run, sudo user='your-user' host='your-server' port='your-port' command = 'ps -ef' output['running'] = False # Avoid fabric to output…
blueFast
  • 41,341
  • 63
  • 198
  • 344
0
votes
2 answers

Restart Gunicorn_django via Fabric

I'm building a Django application and I decided to investigate Fabric for automating deployment. I've got it mostly working, but it fails at the last step, and I can't seem to puzzle out why. I'm using Nginx and Gunicorn to serve the application,…
Matthew Daly
  • 9,212
  • 2
  • 42
  • 83
0
votes
0 answers

Fabric directory copy with status of copying

I am trying to copy a directory from a local to remote system using Fabric in Python. The directory is rather large ~150MB and I am using put() function to copy the folder. The problem I see is that most of the times, the command gets stuck and…
ic10503
  • 131
  • 4
  • 16
0
votes
1 answer

Fabric deployment with virtualenv - which user?

I'm trying to deploy an "app" written on top off web.py with fabric on a VPS running Arch Linux. But I'm confused about best pratices regarding Fabric and virtualenv: which user should I use to create the virtualenv and how do I do that using…
user1319936
0
votes
1 answer

Python raw input and system.split in a fab file

Python newbie here. Lets say I have this: def test_servers(): env.user = getpass.getuser() env.hosts = [] And I want to do something like this: def test_servers(): env.user = getpass.getuser() system =…
Kryten
  • 595
  • 3
  • 10
  • 25
0
votes
1 answer

Automatically read requirements.txt in fabric or deploy

I have a flask app where I'm trying to automate deployment to EC2. Not a big deal, but is there a setting in either Fabric or Distribute that reads the requirements.txt file directly for the setup.py, so I don't have to spell everything out in the…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
0
votes
1 answer

Running a python app on AWS with fabric

I'm trying to run a python web app on AWS. It works fine if I log into AWS with SSH. But with fabric this does not work. I tried: run('python app.py &') And: sudo('python app.py &') No repsonse: $ python awsstart.py run [ec2-user@XYZ] run: python…
RParadox
  • 6,393
  • 4
  • 23
  • 33
0
votes
1 answer

ssh python fabric

I don't actually understand how to do that. I have access to local computer for example 192.168.1.101 with some_user. From that computer i have access to another comp (via vpn) 10.0.132.17 and only from here i can reach access to computer…
Tapo4ek
  • 131
  • 1
  • 6
0
votes
1 answer

Running Django syncdb and migrations with Chef

We are moving towards deploying our Django apps with Chef. One question I have is what is the best way to handle the following commands: ./manage.py syncdb ./manage.py migrate --noinput ./manage.py collectstatic --noinput I'm using the application…
Chris
  • 317
  • 1
  • 2
  • 10
0
votes
1 answer

Fabric String Issue

I am a complete beginner with Python and fabric. I have the following code: def initialise_clients( hostlist): env.roledefs['clients']=hostlist print hostlist print("Setting up deployment: running on %d nodes \n" % len(hostlist)) …
user1018513
  • 1,682
  • 1
  • 20
  • 42
0
votes
1 answer

fabric pass arguments to roledefs

I know using fabric, you can pass arguments to fabric task like: def task(something=''): print "You said %s" % something fab task:something='hello' what if I want to pass some arguments to roledefs. Here is my example: env.roledefs = { …
Shengjie
  • 12,336
  • 29
  • 98
  • 139
0
votes
1 answer

Get celery each task log

Right now I'm using celery to handle my deployment script(fabric). So I need to save every project deployment log to database, then later I can check whether the deployment run perfectly or not. However I still haven't found the right way to save…
Agus
  • 73
  • 4
0
votes
1 answer

Fabric raise error if grep results returned

I am using Fabric to deploy Django (of course). I want to be able to run a local command which greps a string, and if returns any results, raises an exception and halts deploy. Something like: local('grep -r -n "\s console.log" .') So if I get > 0…
Darwin Tech
  • 18,449
  • 38
  • 112
  • 187