Changes

Jump to: navigation, search

OPS435 Online Assignment 2S

6,320 bytes added, 09:06, 24 November 2020
Suggested work-flow for this assignment
== Overview ==
: Study the Fabric API run(), sudo(), local(), and put() and utilize them to create a four new Fabric task tasks called userAdmin::* addUser(username):* findUser(username):* listUser():* listSysUser(): The userAdminaddUser(username) task should perform the following activities operations on a remote machine tosystem::* create a new user when necessary information is provided, and if the user name is already exist, the operation should fail.: The findUser(username) task should perform the following operations on a remote system::* scan the appropriate file(s) on the remote system and determine whether the named user exist or not and report accordingly.: The listUser() task should perform the following operations on a remote system::* delete an existing scan the appropriate file(s) on the remote system and produce a list of shell user when it is safe names on the system. Shell users are those users who can login to do sothe remote system and get a bash shell.: The listSysUser() task should perform the following operations on a remote system::* scan the appropriate file(s) on the remote system and produce a list of system user (non-shell) name on the system. System users are those users who will not get a bash shell.
== Tasks for this assignment ==
== Sample outputs from running your Fabric task file ==
Name of fabric file: a2s_rchan.py
 
=== list of fabric commands ===
<pre>
[raymond.chan@mtrx-node05pd lab8]$ fab -f a2s_rchan.py -l
Available commands:
 
addUser add a user with given user name to remote system
findUser find user with a given user name
listSysUser return a list of system (non-shell) user
listUser return a list of shell user on a remote system
</pre>
 
=== Test run the addUser task ===
<pre>
[raymond.chan@mtrx-node05pd lab8]$ fab -f faba2.py --host=myvmlab.senecacollege.ca --port=7598 addUser:ops435
[myvmlab.senecacollege.ca] Executing task 'addUser'
[myvmlab.senecacollege.ca] ...
 
Done.
Disconnecting from myvmlab.senecacollege.ca:7598... done.
</pre>
 
=== Test run the findUser task ===
<pre>
[raymond.chan@mtrx-node05pd lab8]$ fab -f faba2.py --host=myvmlab.senecacollege.ca --port=7598 findUser:ops435
[myvmlab.senecacollege.ca] Executing task 'findUser'
...
...
 
[myvmlab.senecacollege.ca] out:
 
Found user ops435 on the system.
 
Done.
Disconnecting from myvmlab.senecacollege.ca:7598... done.
</pre>
Another test run:
<pre>
[raymond.chan@mtrx-node05pd lab8]$ fab -f faba2.py --host=myvmlab.senecacollege.ca --port=7598 findUser:seneca
[myvmlab.senecacollege.ca] Executing task 'findUser'
...
...
[myvmlab.senecacollege.ca] out:
 
User seneca is not on the system.
 
Done.
Disconnecting from myvmlab.senecacollege.ca:7598... done.
</pre>
=== Test run the listUser task ===
<pre>
[raymond.chan@mtrx-node05pd lab8]$ fab -f faba2.py --host=myvmlab.senecacollege.ca --port=7598 listUser
[myvmlab.senecacollege.ca] Executing task 'listUser'
...
...
 
['root', 'raymond', 'chan', 'ops435']
 
Done.
Disconnecting from myvmlab.senecacollege.ca:7598... done.
</pre>
=== Test run the listSysUser task ===
<pre>
[raymond.chan@mtrx-node05pd lab8]$ fab -f faba2.py --host=myvmlab.senecacollege.ca --port=7598 listSysUser
[myvmlab.senecacollege.ca] Executing task 'listSysUser'
...
...
[myvmlab.senecacollege.ca] out:
 
['bin', 'daemon', ... 'postfix', 'chrony', 'ntp']
 
Done.
Disconnecting from myvmlab.senecacollege.ca:7598... done.
</pre>
== Suggested work-flow for this assignment ==
=== create a <font color="blue">private</font> repository on github ===
* Use the same github account you have used for your assignment 1 repository.
* Create a private repository named "ops435-a2s" for this assignment.
* Populate your private repository with appropriate files.
 
=== Add collaborator to your ops435-a2s private repository ===
* Add your professor's github account as one of the collaborators to your ops435-a2s private repository. This will allow your professor to pull the contents of your ops435-a2s repository and also to review and suggest changes and fixes to your algorithm and/or your fabric file.
* <b><font color='blue'>Make sure that your professor accepted your invitation from github.com.</font></b>
 
=== Detail Algorithm Document ===
Follow the standard computation procedure: input - process - ouput when creating the algorithm document for this assignment.
==== input ====
* what data do you need for each system administration operation
==== processing ====
* what commands and in what order they should be executed
==== output ====
* what information should be display or return
 
==== identify and select appropriate fabric API for each task ====
You can use the following as the template for your fabric file:
<pre>
from fabric.api import *
'''
OPS435 Assignment 2S - Fall 2020
Program: a2r_[seneca_id].py
Author: Student Name"
The python code in this file a2s_[seneca_id].py is original work written by
[Student Name]. No code in this file is copied from any other source
including any person, textbook, or on-line resource except those provided
by the course instructor. I have not shared this python file with anyone
or anything except for submission for grading.
I understand that the Academic Honesty Policy will be enforced and violators
will be reported and appropriate action will be taken.
'''
 
env.user = "student"
 
def addUser(name):
'''add a user with given user name to remote system'''
...
def listUser():
'''return a list of shell user on a remote system'''
...
 
def listSysUser():
'''return a list of system (non-shell) user'''
...
 
def findUser(name):
'''find user with a given user name'''
...
 
</pre>
 
=== fabric file coding and debugging ===
Once you have finished coding a task, you should test run it on matrix and verify its correctness.
=== Final Test===
Once you have all the individual task tested and that each is working properly, perform the final test and compare with the sample tests and verify that your fabric tasks produce the correct results before submitting it on Blackboard.
 
== Rubric ==
 
{| class="wikitable" border="1"
! Task !! Maximum mark !! Actual mark
|-
| Algorithm||20 ||
|-
| addUser || 20 ||
|-
| findUSer || 20 ||
|-
| listUser|| 20 ||
|-
| listSysUser|| 20 ||
|-
| '''Total''' || 100 ||
 
|}
 
== Submission ==
* Stage 1: upload your algorithm document file to your ops435-a2s repository in github.com by November 25, 2020
* Stage 2: upload your fabric file for this assignment to your ops435-a2s repository in github.com by Dec 2, 2020
* Stage 3: After fully tested and debugged your fabric file for this assignment, update your algorithm, your fabric file, and your test results to your ops435-a2s repository in github.com. Also submit the algorithm document, the fabric file and final test result to blackboard by Dec 4, 2020
1,760
edits

Navigation menu