1,760
edits
Changes
→PART 1: Simplest example
: On matrix, cd to your lab8 directory and create a simple fabric script file named '''fabfile.py''' (this is the default filename used by the fab command when you invoke it without the '-f' optino):
== PART 1: Simplest Non-privileged task example =====Creating Create non-privileged tasks: Getting the hostname of remote machines===
: Add the following contents to the default fabric script called "fabfile.py" in your lab8 directory:<source lang="python">
from fabric.api import *
:You should get used to the above messages from the '''fab''' command. It's a lot of output but it's important to understand where every part is coming from, so you are able to debug problems when they happen.
==PART 2: Privileged Tasks Examples =Creating ====Creat privileged tasks: install and remove rpm package on remote machines===
: Add the following two new functions to the end of the fabric script "fabfile.py" in your lab8 directory:<source lang='bash'>