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
|