Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions playbooks/roles/provision_aws/tasks/ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- name: Create master instance(s)
ec2:
region: "{{ aws_region }}"
zone: "{{ aws_zone }}"
instance_type: "{{ ec2_instance_type_master }}"
image: "{{ ec2_ami_ids[aws_region][ec2_ami_type] }}"
key_name: "{{ ec2_key_name }}"
Expand Down Expand Up @@ -55,6 +56,7 @@
- name: Create infra instance(s)
ec2:
region: "{{ aws_region }}"
zone: "{{ aws_zone }}"
instance_type: "{{ ec2_instance_type_infra }}"
image: "{{ ec2_ami_ids[aws_region][ec2_ami_type] }}"
key_name: "{{ ec2_key_name }}"
Expand Down Expand Up @@ -103,6 +105,7 @@
- name: Create app instance(s)
ec2:
region: "{{ aws_region }}"
zone: "{{ aws_zone }}"
instance_type: "{{ ec2_instance_type_app }}"
image: "{{ ec2_ami_ids[aws_region][ec2_ami_type] }}"
key_name: "{{ ec2_key_name }}"
Expand Down
2 changes: 2 additions & 0 deletions playbooks/roles/provision_aws/tasks/ec2_teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
filters:
tag:OpenShiftClusterName: "{{ cluster_name }}"
tag:OpenShiftClusterNameVerbose: "{{ cluster_name_verbose }}"
availability-zone: "{{ aws_zone }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to limit by availability zone here either.

register: ec2_find_instances

- name: Delete elastic IPs for instances
Expand All @@ -19,6 +20,7 @@
- name: Delete EC2 instances
ec2_instance:
region: "{{ aws_region }}"
availability_zone: "{{ aws_zone }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to limit by availability zone here as it should still find the EC2 instances to delete. You can remove it.

filters:
tag:OpenShiftClusterName: "{{ cluster_name }}"
tag:OpenShiftClusterNameVerbose: "{{ cluster_name_verbose }}"
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/provision_aws/tasks/vpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
ec2_vpc_subnet:
vpc_id: "{{ ec2_vpc_id }}"
region: "{{ aws_region }}"
az: "{{ aws_zone }}"
cidr: "{{ ec2_vpc_cidr_block }}"
map_public: yes
tags:
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/provision_aws/tasks/vpc_teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ec2_vpc_subnet:
vpc_id: "{{ ec2_vpc_id }}"
region: "{{ aws_region }}"
az: "{{ aws_zone }}"
cidr: "{{ item.cidr_block }}"
state: absent
with_items: "{{ ec2_find_subnets.subnets }}"
Expand Down
2 changes: 2 additions & 0 deletions vars/aws.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ cert_email_address: [email protected]

# The AWS region (i.e. `us-east-1`)
aws_region: us-east-1
# The AWS Availability Zone (i.e `us-east-1a`)
aws_zone: us-east-1a
# If you have Cloud Access setup for your account, set this to `cloud_access`. Otherwise, set this to `hourly`.
ec2_ami_type: cloud_access
# The ID of the Route53 hosted zone
Expand Down