Open main menu

CDOT Wiki β

Changes

OPS435 Python3 Lab 8

184 bytes added, 15:25, 10 November 2019
INVESTIGATION 3: Multiplying your work
= INVESTIGATION 3: Multiplying your work =
: After completing all the previous parts of the lab - you should have a working fabfile.py with two three working functions: setupFirewallgetDiskUsage(), performSoftwareUpdate() and setupWebServergetFirewallConfig().
'''** Optional **'''You were asked to test them on worker1. Now let's run these two three functions on all your workers at the same time. The command is almost the same, except for the list of IP addresses:
<source lang="bash">fab --fabfile=fabfile.py -H 192.168.56122.11169,192.168.56122.12170,192.168.56122.13171,192.168.56122.14,192.168.56.15 setupWebServer172 getDiskUsage</source>
: Again - your IP addresses will be different but the command will be the same.
: You can also reconfigure the firewall run all three tasks on all the workers at the same time, using a by adding any task to your fabfile.py:<source lang="python">def doAllThree(): getDiskUsage() getFirewallConfig() preformSoftwareUpdate()</source>: And run the following command like this on your controller:
<source lang="bash">fab --fabfile=fabfile.py -H 192.168.56122.11169,192.168.56122.12170,192.168.56122.13171,192.168.56122.14,192.168.56.15 setupFirewall172 doAllThree</source>
And imagine that you might have 10 tasks to be done on 10, 50, 100 servers to do this on - could you do it without the automation?
= Final Task - Apply fabfile.py to your VM on myvmlab =
1,760
edits