Changes

Jump to: navigation, search

OPS435 Python Lab 8

690 bytes added, 12:32, 30 December 2017
INVESTIGATION 2: Fabric practice
<source lang="python">env.user = 'root'</source>
 
That should have worked, and you'd get output like this:
 
<pre>$ fab --fabfile=fabfile.py -H 192.168.56.11 getHostname
[192.168.56.11] Executing task 'getHostname'
[192.168.56.11] run: whoami
[192.168.56.11] out: root
[192.168.56.11] out:
 
[192.168.56.11] run: hostname
[192.168.56.11] out: www
[192.168.56.11] out:
 
worker1
 
Done.
Disconnecting from 192.168.56.11... done.
</pre>
 
In the above you have:
* Lines with an IP address telling you which worker the output is for/from.
* Messages from the controller (e.g. "Executing task...", and "run: ...").
* Output from the worker ("out: ...")
* Output on the controller from your fab file ("worker1" which came from the "print()" call)
= LAB 7 SIGN-OFF (SHOW INSTRUCTOR) =

Navigation menu