Open main menu

CDOT Wiki β

Changes

OPS435 Online Lab8

15 bytes added, 07:53, 22 March 2021
LAB 8 SIGN-OFF (SHOW INSTRUCTOR)
== Prerequisites ==
:# Has the user account named "stduentstudent" and password for your VM with access port on myvmlab.senecacollege.ca
:# Regular account on Matrix.senecacollege.ca
: Notice that there is no need to specify the user name at the '''fab''' command line since we defined it in the fabric script file (env.user = 'student'). Also notice that we can capture the host name returned from the "hostname" command and print it out together with an descriptive text in a line.
:In the above executed '''fab''' command, the fab program imports the fabric script named "fabfile.py" and execute the getHostname function on the VM connect at port 7200 on myvmlab.senecacollege.ca. Note that the port number for your first VM will likely be of has a different value.
: If you did all the setup right and you got a password prompt when execute the above command, read the prompt carefully and see who's password it was prompting you for. If it is not for the user student, verify that you have the following line in your fabfile.py and you can ssh to your VM as the user student without password:
:* Output generated on the controller workstation from your fab file (the print statement)
: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 each piece of information is coming from, so you are able to debug problems when they happen.
== PART 2: Privileged Tasks Examples ==
</source>
= Optional Lab Exercise: Create a Fabric task called makeUser() =
: Study the Fabric API run(), sudo(), local(), and put() and utilize them to create a new Fabric task called makeUser()
: The makeUser() task should perform the following on a remote machine to:
= LAB 8 SIGN-OFF (SHOW INSTRUCTOR) =
: Complete all the parts each part of the lab and upload the version of your fabfile.py to Blackboard by the due date.
[[Category:OPS435-Python]][[Category:rchan]]
1,760
edits