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: connect to remote server, then execute commands after sudo su - user2

I need to write a python script which must be able to connect to a remote server (to user1), execute some commands (this was easy), then it must switch to user2 through sudo su - user2, and execute some commands (the problem is here). How can make…
smarber
  • 4,829
  • 7
  • 37
  • 78
0
votes
1 answer

how can I leverage native Windows ODBC drivers remotely via fabric?

I can connect to a system DSN running my cygwin compatible fork of pypyodbc locally on Windows 7, but when I try to run the same script via SSH/fabric, I get a permission error: [192.168.x.x] out: conn =…
Tony
  • 625
  • 1
  • 6
  • 17
0
votes
1 answer

Fabric get task attributes

I defined a fabric def using decorators like below: @task(alias=dp) def deploy: # the code But I want to have access to the alias inside my def? I can't use self. to get access :(
Kakawait
  • 3,929
  • 6
  • 33
  • 60
0
votes
1 answer

Python fabric with EC2 instance

I am working on setting up auto deployment script using Python Fabric on EC2 instance. We are already having code repositories cloned on EC2 instance with HTTPS (without user name,https://bitbucket.org/) instead of SSH. If we clone the repositories…
0
votes
1 answer

how to set dynamic hosts in fabric

the code below can set the dynamic hosts: def set_hosts(): env.hosts = ['host1', 'host2'] def mytask(): run('ls /var/www') but I only can run this in shell,and the job will work sequential not in parallel: fab set_hosts mytask how to run…
kuafu
  • 1,466
  • 5
  • 17
  • 28
0
votes
1 answer

disable sandboxing of google app engine dev server as a replacement for bash scripts / fabric

I want a website on my local computer that has options such as: "create file", "zip folder", etc. When such hyperlinks are clicked on the local website, the webhandler would run commands such as open("new-file", 'w') etc. I was wanting to use the…
Rusty Rob
  • 16,489
  • 8
  • 100
  • 116
0
votes
0 answers

Why isn't Fabric running my deployment in parallel when I use the -P command line option?

I'm running Fabric on Debian out of virtualenv to deploy a project to multiple remote Debian servers. When I run the command to deploy to a single server: time .venv/bin/fabric server1 deploy The server1 command sets the remote host. Deployment,…
klenwell
  • 6,978
  • 4
  • 45
  • 84
0
votes
1 answer

Why does Capistrano need modifications to use something like pythonbrew?

As I understand, all that Capistrano does is ssh into the server and execute the commands we want it to (mostly). I've used rvm in some past couple of projects, and had to install the rvm-capistrano gem. Otherwise, it failed to find the executables…
Siddhant
  • 2,535
  • 4
  • 20
  • 22
0
votes
1 answer

Fabric Assign Hosts Using a List Variable

I know I can assign hosts with fabric by doing this: env.hosts = ['host1', 'host2'] But can I do this? myList = ['host1', 'host2'] env.hosts = myList I am getting a list of 'public_dns_name's using Boto (from Amazon AWS) and then want to run…
Bill Rosmus
  • 2,941
  • 7
  • 40
  • 61
0
votes
1 answer

how to run automation task in different group using fabric

I want to run different command on the different pc group. my fabric file like following: env.hosts = ['125.221.225.31','125.221.225.36','125.221.225.33','125.221.225.34','125.221.225.35'] env.roledefs = { 'master':['125.221.225.31'], …
kuafu
  • 1,466
  • 5
  • 17
  • 28
0
votes
1 answer

Fabric and init

I am using fabric to restart tomcat and even though it says tomcat restarted successfully it does not. So, as per the FAQ, I set pty=False and tried again. But, now, I get this error: sudo: /etc/init.d/tomcat restart out: sudo: sorry, you must have…
0
votes
1 answer

how do I exec a task in a screen session with fabric?

In fabric, what's the easiest way to run a long-running command in a detached state, such as in a screen session, so that I can disconnect and it would continue to run?
Paul Lam
  • 1,729
  • 1
  • 15
  • 25
0
votes
0 answers

All fabric actions result in 'Warning X encountered an error (return code 1) while executing Y'

For some reason all my fabric actions executed on the remote server are failing with the error: Fatal error: X encountered an error (return code 1) while executing 'Y'. In this case 'X' are all kinds of fabric actions (run, sudo, etc.) as well as…
jroeleveld
  • 456
  • 4
  • 12
  • 22
0
votes
1 answer

Fabric problems with reloading supervisor on remote host

My project is hosted on Webfaction and supervisor is used to be aware of processes. I use shell utils to get the PID of supervisor and it works just fine when I do it manually, but I got random PIDs when executing the same command remotely with…
sultan
  • 5,978
  • 14
  • 59
  • 103
0
votes
2 answers

Python module variable interdependency

I am trying to create a module to hold configurations for a Fabric file. This configuration file will hold project dependent settings, so I can use the same fabfile for all our projects. I want the fabfile to look like this: import config from…
Martin
  • 5,954
  • 5
  • 30
  • 46
1 2 3
99
100