Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
detiber committed Oct 18, 2016
1 parent 57c8f0d commit f86baf1
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Parameters:
MasterApiPort:
Type: Number
Default: 443
KeyName:
Type: 'AWS::EC2::KeyPair::KeyName'


VpcId:
Expand Down Expand Up @@ -56,7 +58,10 @@ Parameters:
Type: String
Default: 'https://s3.amazonaws.com/openshift-cloudformation-templates/iam-profiles/default.yaml'


MasterUserData:
Type: String
MasterInstanceSubnets:
Type: CommaDelimitedList
ControlPlaneTemplateUrl:
Type: String
Default: 'https://s3.amazonaws.com/openshift-cloudformation-templates/control-plane/default.yaml'
Expand Down Expand Up @@ -168,3 +173,65 @@ Resources:
Properties:
TemplateURL:
Ref: ControlPlaneTemplateUrl
Parameters:
MasterSGs:
'Fn::If':
- CreateSecurityGroups
- 'Fn::GetAtt':
- SGStack
- Outputs.MasterSecurityGroups
- Ref: MasterSecurityGroups
MasterExtElbSGs:
'Fn::If':
- CreateSecurityGroups
- 'Fn::GetAtt':
- SGStack
- Outputs.MasterExtElbSecurityGroups
- Ref: MasterExtElbSecurityGroups
MasterIntElbSGs:
'Fn::If':
- CreateSecurityGroups
- 'Fn::GetAtt':
- SGStack
- Outputs.MasterIntElbSecurityGroups
- Ref: MasterIntElbSecurityGroups
MasterInstanceProfile:
'Fn::If':
- CreateIAMProfiles
- 'Fn::GetAtt':
- IAMStack
- Outputs.MasterInstanceProfile
- Ref: MasterInstanceProfile
MasterApiPort:
Ref: MasterApiPort
KeyName:
Ref: KeyName
MasterUserData:
Ref: MasterUserData
Master01Subnet:
'Fn::If':
- CreateVpc
- 'Fn::GetAtt':
- VpcStack
- Outputs.VpcSubnet1
- 'Fn::Select':
- 0
- Ref: MasterInstanceSubnets
Master02Subnet:
'Fn::If':
- CreateVpc
- 'Fn::GetAtt':
- VpcStack
- Outputs.VpcSubnet2
- 'Fn::Select':
- 1
- Ref: MasterInstanceSubnets
Master03Subnet:
'Fn::If':
- CreateVpc
- 'Fn::GetAtt':
- VpcStack
- Outputs.VpcSubnet3
- 'Fn::Select':
- 2
- Ref: MasterInstanceSubnets
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@ Outputs:
- CreateSubnet4
- Ref: Subnet4
- Ref: 'AWS::NoValue'
VpcSubnet1:
Description: VPC Subnet01
Value:
Ref: Subnet1
VpcSubnet2:
Value:
'Fn::If':
- CreateSubnet2
- Ref: Subnet2
- Ref: Subnet1
VpcSubnet3:
Value:
'Fn::If':
- CreateSubnet3
- Ref: Subnet3
- Ref: Subnet1
VpcSubnet4:
Value:
'Fn::If':
- CreateSubnet4
- Ref: Subnet4
- 'Fn::If':
- CreateSubnet2
- Ref: Subnet2
- Ref: Subnet1
Parameters:
VpcName:
Type: String
Expand Down
21 changes: 7 additions & 14 deletions playbooks/provisioning/aws/cloudformation/nested_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
- name: 'Bootstrapping or Refreshing Environment'
hosts: localhost
connection: local
sudo: no
become: no
gather_facts: no
vars:
openshift_provisioning_cluster_id: test
openshift_provisioning_env_id: test
openshift_provisioning_aws_keyname: default
openshift_provisioning_aws_region: us-east-1
openshift_provisioning_aws_subnet_azs: "{{ lookup('ec2_zones_by_region', openshift_provisioning_aws_region) }}"
openshift_provisioning_aws_stack_name: openshift-{{ openshift_provisioning_cluster_id }}-{{ openshift_provisioning_env_id }}
openshift_provisioning_aws_num_subnets: "{{ openshift_provisioning_aws_subnet_azs.split(',') | length }}"
tasks:
- debug:
msg: "subnet_list: {{ openshift_provisioning_aws_subnet_azs.split(',') }}"
- name: Launch the CloudFormation Template
cloudformation:
region: "{{ openshift_provisioning_aws_region }}"
Expand All @@ -25,7 +25,7 @@
template: files/nested/three_master_infra_asg_node_asg_no_bastion.yaml
template_parameters:
NamePrefix: "{{ openshift_provisioning_aws_stack_name }}"
NumSubnets: "{{ openshift_provisioning_aws_subnet_azs.split(',') | length }}"
NumSubnets: "{{ openshift_provisioning_aws_num_subnets }}"
SubnetAvailabilityZones: "{{ openshift_provisioning_aws_subnet_azs }}"
MasterSecurityGroups: "{{ openshift_provisioning_aws_master_security_groups | default('') }}"
NodeSecurityGroups: "{{ openshift_provisioning_aws_node_security_groups | default('') }}"
Expand All @@ -36,17 +36,10 @@
MasterIntElbSecurityGroups: "{{ openshift_provisioning_aws_master_int_elb_security_groups | default('') }}"
MasterInstanceProfile: "{{ openshift_provisioning_aws_master_instance_profile | default('') }}"
NodeInstanceProfile: "{{ openshift_provisioning_aws_node_instance_profile | default('') }}"
MasterInstanceSubnets: "{{ openshift_provisioning_aws_master_instance_subnets | default('') }}"
VpcId: "{{ openshift_provisioning_aws_vpc_id | default('') }}"
KeyName: "{{ openshift_provisioning_aws_keyname }}"
MasterUserData: "{{ lookup('file', 'nested/master-user-data.yaml') | b64encode }}"
register: cf_output

- debug: var=cf_output
- debug: var=groups
- debug:
msg: "hosts: {{ groups['tag_' ~ openshift_provisioning_cluster_id] | default([]) }}"

- meta: refresh_inventory

- debug: var=groups
- debug:
msg: "hosts: {{ groups['tag_' ~ openshift_provisioning_cluster_id] | default([]) }}"

0 comments on commit f86baf1

Please sign in to comment.