Changes

Jump to: navigation, search

OPS435 Python3 Lab 8

298 bytes added, 17:27, 3 July 2020
INVESTIGATION 3: Running fab in script mode
= INVESTIGATION 3: Running fab in script mode =
: We will start with some basics. Fabric runs python programs on the controller and the workers. You create an "instruction" file on your controllerFrom investigation 2, and execute it on the controller using the we can see that run '''fab''' programin ad-hoc more is quick, straight forward, and easy. However, the rich output generated can not be easily captured and processed. When If you do that - you specify which workers you want your instructions have a need to be executed capture and process the output generated by the commands execute onthe remote machine, the solution is to run fab in script mode. : The instructions are stored first step in running the fab command in script mode, is to create a python fabric script file. : Let's start with a simple one fabric script file to demonstrate some basic concepts that use the API from the Fabric python library.: 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 example ==
1,760
edits

Navigation menu