Changes

Jump to: navigation, search

OPS435 Python3 Lab 8

214 bytes added, 15:47, 10 November 2019
Final Task - Apply fabfile.py to your VM on myvmlab
And imagine that you might have 10 tasks to be done on 10, 50, 100 servers - could you do it without the automation?
= Final Task Investigation 4 - Apply fabfile.py to your VM on myvmlab === Replace run() function calls with sudo() ==
: Since your account on your vm on myvmlab is a regular user with sudo privilege. You need to make the following changes to your fabfile.py before applying it to your vm on myvmlab:
:* Change env.user from 'root' to your account on your vm in myvmlab.
:* Change all the commands that need super user privilege from calling the run() function to instead calling the sudo() function.Here is an example on replacing run() with sudo():<source lang="python">def getFirewallConfig(): fw_config = sudo("iptables -L -n -v") print(fw_config) 
: Test your updated fabfile.py until you get the same result as when you apply it to your own worker VM.
1,760
edits

Navigation menu