|
From: | Daniel Lumb |
Subject: | Re: [Fab-user] Using reboot in a fabfile |
Date: | Thu, 9 Aug 2018 10:56:59 +0000 |
Sure, here's a the fabfile - it's very basic and it's just me testing out some automated upgrades in Ubuntu. Pointers and advice are welcome. Basically I have another python script that acts as a wrapper for the fabfile, selecting server targets and then invoking 'fab' from the cli to run the jobs. This probably isn't the best way to do it but...
http://dpaste.com/0H7GNX8 . -- some of the indenting got messed up but you get the idea!
As you can see, I've resorted to using "at" to schedule the reboots...
Another aspect I'm confused with is error handling and output manipulation. I'd love to be able to grab output from each "job", which seems like it may be difficult, especially during parallel execution tasks.
Thanks, Dan From: Fab-user <fab-user-bounces+address@hidden> on behalf of Jacob McCoy Wade <address@hidden>
Sent: 08 August 2018 16:27:53 To: address@hidden Subject: Re: [Fab-user] Using reboot in a fabfile Well, unless you are connecting to the server as root, you are probably going to need to use sudo?
@task
def reboot():
With hide(“everything”), show (“stderr”):
sudo(‘reboot’)
???
|
[Prev in Thread] | Current Thread | [Next in Thread] |