Final project
You should utilize anything that you have learned throughout the course.
In the end, I should be able to run a command that receives a users
file formatted like this (though the length of the users file could vary). The following should occur:
- a unique ubuntu machine should be created for the user, the name of each machine should be something like
ub-username
(but replace username with the one from the file). - the user should be created on the machine.
- the machine should be configured to serve webpages on port 80.
- The default index page should say
Hello, this is user's webpage
. (user will be replaced by the actual username) - a new set of keys should be generated in your project directory, (perhaps in a subdirectory called
keys
) And your instances should accept that key for ssh. To generate an ssh key in this directory you can dossh-keygen -f keys/tfkey -t rsa -N ""
. This is the key that should be used for your terraform instances. You can then ssh to the machine using thessh -i
option.
Restrictions:
- you cannot manually modify anything in the user file
- you can only run a single command
- you cannot hardcode the users names anywhere, everything should be dynamically created.
Hints:
- I would probably start with a shell script which in turn invokes the appropriate terraform and ansible commands.
To pass off
Create a README file that explains how I should run your project and any other useful information for me.
You should tar up everything and upload to canvas. You can tar up a directory named finalexam
like this: tar -cvvf exam.tar finalexam
. Make sure to NOT include any hidden terraform directories as this will BLOAT your submission file. You can optionally choose to gzip your submission. If you use rar or zip or some other thing, you may be penalized.
Last Updated 02/07/2025