fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] general settings .fabricrc


From: Fabien Murgues
Subject: Re: [Fab-user] general settings .fabricrc
Date: Thu, 19 Apr 2012 14:13:15 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

Juste one mistake :
The command line :
address@hidden:~/fabric$ fab -c /home/user/.fabricrc -f fab.py -R test1 boot


On 19/04/12 11:51, Fabien Murgues wrote:
Hello,

    To get back to my precedent post, I have a problem with the .fabrirc file.
I try to put in this file (~/.fabricrc) the general settings fro my script (like hosts and passwords), but when I execute my script it does not work.
    Maybe I made a mistake with the use of this file, I am looking for a general settings file.

The .fabricrc :
from fabric.api import env

env.roledefs = {
    'test1' : ['address@hidden'],
    'test2' : [ 'address@hidden'2],
    'all' : [ 'address@hidden', 'address@hidden'],
    }

env.passwords = {'address@hidden': 'aaaa', 'address@hidden': 'bbbb'}
The fabric file fab.py :
from fabric.api import run,env,sudo,hide

def boot():
    run('uptime')

def version():
    with hide('running'):
        val = run("awk '{print $1}' /etc/issue | head -n 1")
    if val == "Ubuntu":
        run("echo UBUNTU")
    if val == "Debian":
        run("echo DEBIAN")

def update():
    sudo("aptitude update; aptitude safe-upgrade")

The command line :
address@hidden:~/fabric$ fab -c /home/user/.fabricrc -f fab.py -H test1 boot
[test1] Executing task 'boot'
[test1] run: uptime

Fatal error: Name lookup failed for test1

Aborting.


With all the commands in one file, everything is ok...




-- 


Cordialement, 
Fabien Murgues 

Service Commun Documentation Saint Etienne 
Informatique 
23 rue Docteur Paul Michelon 
42023 Saint Etienne Cedex 2 

tél : 04 77 48 15 92 
fax : 04 77 48 15 91


_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user

-- 


Cordialement, 
Fabien Murgues 

Service Commun Documentation Saint Etienne 
Informatique 
23 rue Docteur Paul Michelon 
42023 Saint Etienne Cedex 2 

tél : 04 77 48 15 92 
fax : 04 77 48 15 91

Attachment: fabien_murgues.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]