Skip to content

Commit

Permalink
vpc finished
Browse files Browse the repository at this point in the history
  • Loading branch information
ducksauser committed Dec 2, 2020
1 parent be932c2 commit 521a42d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ you would get if you were to do use the Installer-Provision Infrastructure
quite a few tags that are critical to ensuring that you can take advantage of
all cloud integration features in OpenShift 4.

To improve that exprience and to ensure the infrastructure provided by default
To improve that experience and to ensure the infrastructure provided by default
matches as closely as possible to what you would get if you used the IPI method
of deployment, this repository includes modified versions of each of the
CloudFormation templates to fix those issues.
Expand All @@ -23,11 +23,7 @@ You can find the templates here:
| Template | Original | Modified |
| ------------------------ | -------------------------------------------------------------------- | ----------------------------------------------------------- |
| VPC | [original](playbooks/aws/cloudformation/vpc.original.yaml) | [modified](playbooks/aws/cloudformation/vpc.yaml) |
| Network / Load Balancing | [original](playbooks/aws/cloudformation/network.original.yaml) | [modified](playbooks/aws/cloudformation/network.yaml) |
| Security | [original](playbooks/aws/cloudformation/security.original.yaml) | [modified](playbooks/aws/cloudformation/security.yaml) |
| Bootstrap | [original](playbooks/aws/cloudformation/bootstrap.original.yaml) | [modified](playbooks/aws/cloudformation/bootstrap.yaml) |
| Control Plane | [original](playbooks/aws/cloudformation/control_plane.original.yaml) | [modified](playbooks/aws/cloudformation/control_plane.yaml) |
| Worker | [original](playbooks/aws/cloudformation/worker.original.yaml) | [modified](playbooks/aws/cloudformation/worker.yaml) |

Also included is a playbook that ties each of the CloudFormation templates
together by matching the outputs of CloudFormation stacks to parameters to
Expand All @@ -43,17 +39,11 @@ Example variable file:
# Required Variables
###############################################################################

cluster_name: test
base_domain: example.com
infrastructure_name: test-fgmdv
cluster_name: example
base_domain: redhat.com
infrastructure_name: example

hosted_zone_name: "{{ base_domain }}"
hosted_zone_id: Z05602532C4FRVJXEMAGM

rhcos_ami: ami-0f4ecf819275850dd

bootstrap_ignition_location: 's3://com-example-test-ignition/bootstrap.ign'
ignition_ca: 'data:text/plain;charset=utf-8;base64,LS0tLS1CRUdJ...'

###############################################################################
# Optional Variables
Expand All @@ -65,9 +55,6 @@ subnet_bits: 12

allowed_bootstrap_ssh_cidr: 0.0.0.0/0

auto_register_elb: "yes"

master_instance_type: m5.xlarge
```
Execute the playbook:
Expand All @@ -76,5 +63,10 @@ Execute the playbook:
ansible-playbook -e @vars/aws.yml playbooks/aws/playbook.yml -v
```

Purge the Cloudformation stacks:

```bash
ansible-playbook -e @vars/aws.yml playbooks/aws/purge-stack.yaml -v
```

[1]: https://docs.openshift.com/container-platform/latest/installing/installing_aws/installing-aws-user-infra.html
24 changes: 24 additions & 0 deletions playbooks/aws/purge-stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---

- hosts: localhost
tasks:
- name: Purge security components using CloudFormation
cloudformation:
stack_name: "{{ infrastructure_name }}-security"
state: absent
register: r_cf_security

- name: Debug output for security components creation
debug:
var: r_cf_security

- name: Purge VPC using CloudFormation
cloudformation:
stack_name: "{{ infrastructure_name }}-vpc"
state: absent
register: r_cf_vpc

- name: Debug output for VPC creation
debug:
var: r_cf_vpc

0 comments on commit 521a42d

Please sign in to comment.