Generate lab infrastructure for an Ansible class.
There are two modes of operation. The first is to create a series of instances which serve as students' workstations for running the class exercises.
The second is to run from within a student's workstation to create/destroy a second instance which she can provision via Ansible.
You will also need an AWS account, properly set up with a project and
service account credentials, and a DNS domain set up in Route53.
Replace all occurrences of my domain foam.ninja
with your own.
- Run
generate_workstation_list.py
to create the list of hostnames to be created. - Ensure that
workstation/keys
contains (a) Google Cloud credentials and (b) an SSH keypair. Don't check this directory into source control! cd
intoworkstations
and runterraform init ; terraform up
.
Instances will be created such that, for an instance
foo-bar.foam.ninja
, the user foo
exists with the password bar
.
Inside that user's home directory will be directories containing the
class materials, and a .profile
to automagically prepare to run
Ansible.
Also inside the user's home directory will be a configuration of the
Magrathea project itself, suitable for creating a second instance
alpha.foo-bar.foam.ninja
for the student to
- SSH into the workstation
cd
tomagrathea/workstation
and runterraform init ; terraform up
.