<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=299788&amp;fmt=gif">
Skip to content

We've been on-boarding more Technical Consultants lately and we've been improving how we introduce them to our technology stack. We had a need to have a learning environment for two technologies:

  • Ansible - used on more and more of our technical engagements. We use this to deploy the Atlassian applications and more.
  • Click2Clone - we deploy this on many customer engagements as both a migration utility and to restore data from production applications to lower tiers

We wanted new people to be able to test both of these tools end-to-end in an environment that had enough resources to provide "real world experience". This seemed easy enough at first. I thought we'll just spin up instances in AWS and hand over the keys. But there was a need to isolate this learning environment from everything else we are doing. We also wanted to add some extra challenges that needed to be figured out along the way. With new requirements I decided we needed something more repeatable that would also minimize the amount of time the facilitator had to take away from customer work in order to stand up.

Enter Ansible....again.

Using an Ansible playbook and CloudFormation I was able to automate everything from the EC2 Key Pair creation, standing up of a VPC with both public and private subnets, then standing up three EC2 Instances (Jira Prod, Jira Dev and a Click2Clone instance) and two PostgreSQL RDS instances. Lets break this down:

Playbook Options

This section tells Ansible to execute the playbook locally (since we don't yet have any remote instances.

- hosts: "localhost"
connection: "local"
gather_facts: false






This section is the meat and potatoes of this automation. It does the following:

- name: Check if AWS Key Pair Private Key exists
path: ".pem"
register: aws_key_exists

- name: Create AWS Key Pair
- ec2_key:
name: ""
profile: ""
region: ""
key_material: "null"
wait: true
register: aws_key_pair
failed_when: false

- copy:
dest: ".pem"
content: ""

- file:
path: ".pem"
mode: "0600"
when: aws_key_exists.stat.exists == False

- name: Create VPC for Exercise via CloudFormation
profile: ""
stack_name: "-vpc"
region: ""
state: "present"
template: "CloudFormation/VPC_With_Managed_NAT_And_Four_Subnets.yml"
KeyName: ""
SshLocation: ""
BaseImageId: ""
Route53HostedZone: "."
Route53BastionSubdomain: "-bastion"
App: "click2clone-exercise"
register: vpc_stack

- name: Create Infrastructure for Exercise via CloudFormation
profile: ""
stack_name: "-instances"
region: ""
state: "present"
template: "CloudFormation/Exercise.yml"
KeyName: ""
BaseImageId: ""
VpcId: ""
PrivateSubnet1: ""
PrivateSubnet2: ""
PublicSubnet1: ""
PublicSubnet2: ""
BastionSecurityGroup: ""
RdsMasterUserProd: ""
RdsMasterPasswordProd: ""
RdsMasterUserDev: ""
RdsMasterPasswordDev: ""
Route53HostedZone: "."
ElbSslCertArn: ""
App: "click2clone-exercise"
register: ec2_stack

After spinning up all the necessary infrastructure I wondered what to do with all the details. Much of it was set as Outputs from the CloudFormation templates, but how do I easily and securely get that information to the new Technical Consultant?

Check out Jaime's blog post on how we got the infrastructure details along with the pem file into Confluence so that we could give the candidate a single link.

Managing JIRA at Scale White Paper

See More From These Topics