= ansible-skylight config

Author: Jim Rigsbee, jrigsbee@redhat.com

== Overview

Currently the ansible-skylight is used to deploy a classroom based on the
skylight classroom created by the SA Tiger team:
https://github.com/mgmt-sa-tiger-team/skylight.git

== NOTES

To be documented

== Review the Env_Type variable file

* This file link:./env_vars.yml[./env_vars.yml] contains all the variables you
 need to define to control, or customize, the deployment of your environment. In
normal usage this should not need to be touched or ammended and one-off changes
can be tested by passing vars or var files with `-e` or `-e @my_version_vars.yml`.

== Secrets

To be documented


== Running Ansible Playbook

You can run the playbook with the following arguments to overwrite the default variable values:
From the `ansible_agnostic_deployer/ansible` directory run
`
[source,bash]
----
ENVTYPE=ansible-skylight
GUID=test02
CLOUDPROVIDER=ec2
REGION=us-east-1
HOSTZONEID='Z3IHLWJZOU9SRT'
KEYNAME=awskey

ansible-playbook main.yml  \
      -e "guid=${GUID}" \
      -e "env_type=${ENVTYPE}" \
      -e "key_name=${KEYNAME}" \
      -e "subdomain_base_suffix=${BASESUFFIX}" \
      -e "cloud_provider=${CLOUDPROVIDER}" \
      -e "aws_region=${REGION}" \
      -e "HostedZoneId=${HOSTZONEID}" \
      -e "email=name@example.com" \
      -e "output_dir=/tmp/workdir" \
      -e @~/secret.yml \
      -e @~/my_env_vars.yml
----

=== To Delete an environment

[source,bash]
----

REGION=us-east-1
KEYNAME=awskey
GUID=test02
ENVTYPE=ansible-skylight
CLOUDPROVIDER=ec2

ansible-playbook configs/${ENVTYPE}/destroy_env.yml \
        -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \
        -e "cloud_provider=${CLOUDPROVIDER}" \
        -e "aws_region=${REGION}"  -e "key_name=${KEYNAME}"  \
        -e @~/secret.yml \
        -e @~/my_env_vars.yml
----
