Skip to content

Commit

Permalink
Adding sample-vars.yml to three-tier-app, ans-tower-lab, and just-som…
Browse files Browse the repository at this point in the history
…e-nodes-example
  • Loading branch information
tonykay committed Dec 9, 2018
1 parent 5dc7685 commit 1efbe2c
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 64 deletions.
50 changes: 25 additions & 25 deletions ansible/configs/ans-tower-lab/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ From the `ansible_agnostic_deployer/ansible` directory run
[source,bash]
----
ENVTYPE=ans-tower-lab
GUID=test01
GUID=test02
BASESUFFIX='.example.opentlc.com'
CLOUDPROVIDER=ec2
REGION=us-east-1
Expand All @@ -31,48 +31,48 @@ ansible-playbook main.yml \
-e "HostedZoneId=${HOSTZONEID}" \
-e "[email protected]" \
-e "output_dir=/tmp/workdir" \
-e @path_to/aws_credentials.yml
-e @~/secret.yml
----
== Running Ansible Playbook for Homework Assignment

You can run the playbook with the following arguments to overwrite the default variable values:
[source,bash]
----
REGION=ap-southeast-2
REGION=us-east-1
KEYNAME=testkey
GUID=praktest9
GUID=test02
ENVTYPE=ans-tower-lab
CLOUDPROVIDER=ec2
HOSTZONEID='Z3IHLWJZOU9SRT'
BASESUFFIX='.example.opentlc.com'
ansible-playbook \
ansible/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 protected]" \
-e "output_dir=/opt/workdir" \
-e@~/secrets.yml -vv \
-e "deploy_tower_homework=true"
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 protected]" \
-e "output_dir=/opt/workdir" \
-e@~/secrets.yml \
-e "deploy_tower_homework=true"
----



=== To Delete an environment
----
REGION=ap-southeast-2
REGION=us-east-1
KEYNAME=ocpkey
GUID=praktest1
ENVTYPE="three-tier-app"
GUID=test02
ENVTYPE=ans-tower-lab
CLOUDPROVIDER=ec2
ansible-playbook /ansible/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 "subdomain_base_suffix=${BASESUFFIX}" -e@../secret.yml -vv
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 "subdomain_base_suffix=${BASESUFFIX}" \
-e @~/secret.yml -vv
----
11 changes: 11 additions & 0 deletions ansible/configs/ans-tower-lab/sample_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

guid: test01
env_type: ans-tower-lab
key_name: ocpkey
subdomain_base_suffix: .example.opentlc.com'
cloud_provider: ec2
aws_region: us-east-1
HostedZoneId: Z3IHLWJZOU9SRT
email: [email protected]
output_dir: /tmp/workdir"
33 changes: 33 additions & 0 deletions ansible/configs/just-some-nodes-example/foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# sample configuration file
#
# Usage: ansible-playbook main.yml -e @configs/just-some-nodes-example/sample.yml
#
# Ideally keep your copy OUTSIDE your repo, especially if using Cloud Credentials

env_type: three-tier-app # Name of config to deploy
output_dir: /tmp/workdir # Writable working scratch directory
email: [email protected] # User info for notifications

guid: guid01 # Your Global UNIQUE Identifier
subdomain_base_suffix: .example.opentlc.com # Your domain used in FQDN

# Path to yum repos

own_repo_path: http://admin.na.shared.opentlc.com/repos/ocp/3.6/

# Cloud specfic settings - example given here for AWS

cloud_provider: ec2 # Which AgnosticD Cloud Provider to use
aws_region: us-east-1 # AWS Region to deploy in
HostedZoneId: Z3IHLWJZOU9SRT # You will need to change this
key_name: ocpkey # Keyname must exist in AWS

# AWS Credentials. These are required (don't sync them to your fork)
#
# Alternatively consider keeping these in an external file and including:
# $ ansible-playbook main.yml -e @configs/three-tier-app/sample.yml -e @~/secret.yml
#
# aws_access_key_id:
# aws_secret_access_key:
...
10 changes: 6 additions & 4 deletions ansible/configs/just-some-nodes-example/sample_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
#
# Ideally keep your copy OUTSIDE your repo, especially if using Cloud Credentials

#env_type: just-some-nodes-example # Name of config to deploy
env_type: three-tier-app # Name of config to deploy
env_type: just-some-nodes-example # Name of config to deploy
output_dir: /tmp/workdir # Writable working scratch directory
node_instance_count: 2 # Number of nodes to deploy
email: [email protected] # User info for notifications

guid: jsn00 # Unique string used in FQDN
subdomain_base_suffix: example.com # Your domain used in FQDN
guid: guid02 # Unique string used in FQDN
subdomain_base_suffix: .example.opentlc.com # Your domain used in FQDN

# Path to yum repos
own_repo_path: http://admin.na.shared.opentlc.com/repos/ocp/3.6/

# Cloud specfic settings - example given here for AWS

Expand Down
44 changes: 11 additions & 33 deletions ansible/configs/three-tier-app/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,44 +27,22 @@ These can be over-ridden at `ansible-playbook` runtime via `-e` options or perha

For further information on customizing images consult the link:../../../docs/Creating_a_config.adoc[Creating a Config Guide]

== Running Ansible Playbook
== Deploying the Three Tier App Config

You can run the playbook with the following arguments, from the `ansible` directory, to overwrite the default variable values:
[source,bash]
----
REGION=us-east-1
KEYNAME=ocpkey
GUID=guidtest1
ENVTYPE="three-tier-app"
CLOUDPROVIDER=ec2
HOSTZONEID='Z3IHLWJZOU9SRT'
BASESUFFIX='.example.opentlc.com'
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 protected]" \
-e "output_dir=/tmp/workdir" \
-e @~/.aws/credentials.yml
You can deploy this config by running the following command from the `ansible`
directory. You will have to provide credentials and adjust settings to your own
environment.

----
`ansible-playbook -e @configs/three-tier-app/sample_vars.yml main.yml`

=== To Delete an environment
----
REGION=ap-southeast-2
KEYNAME=ocpkey
GUID=praktest1
ENVTYPE="three-tier-app"
CLOUDPROVIDER=ec2
ansible-playbook ./ansible/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 "subdomain_base_suffix=${BASESUFFIX}" -e@../secret.yml -vv
ansible-playbook -e @configs/three-tier-app/sample_vars.yml \
configs/three-tier-app/destroy_env.yml
----




8 changes: 6 additions & 2 deletions ansible/configs/three-tier-app/sample_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ env_type: three-tier-app # Name of config to deploy
output_dir: /tmp/workdir # Writable working scratch directory
email: [email protected] # User info for notifications

guid: jsn01 # Unique string used in FQDN
subdomain_base_suffix: example.opentlc.com # Your domain used in FQDN
guid: guid01 # Your Global UNIQUE Identifier
subdomain_base_suffix: .example.opentlc.com # Your domain used in FQDN

# Path to yum repos

own_repo_path: http://admin.na.shared.opentlc.com/repos/ocp/3.6/

# Cloud specfic settings - example given here for AWS

Expand Down

0 comments on commit 1efbe2c

Please sign in to comment.