Skip to content

Commit

Permalink
QOL-8638 update other to align, fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
duttonw committed Feb 22, 2022
1 parent 1996694 commit 4455705
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion j2Only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
when: basic_fact is defined

roles:
- ansible_cloudformation_jina_only
- ansible_cloudformation_jinja_only
52 changes: 27 additions & 25 deletions templates/Datashades-OpsWorks-CKAN-Instances.cfn.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ Conditions:

Resources:
#solr 1
OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}:
OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}:
Type: AWS::OpsWorks::Instance
Properties:
Hostname: !Sub "${ApplicationId}{% if item.tags["PowerManaged"] == "Yes" %}-PM{% endif %}-solr1"
Hostname: !Sub "${ApplicationId}-solr1-{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref ServicesEC2Size
Expand Down Expand Up @@ -226,11 +226,11 @@ Resources:
{% endif %}

#solr 2
OpswxEC2Services2{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}:
OpswxEC2Services2{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}:
Condition: 2PlusServiceInstances
Type: AWS::OpsWorks::Instance
Properties:
Hostname: !Sub "${ApplicationId}{% if item.tags["PowerManaged"] == "Yes" %}-PM{% endif %}-solr2"
Hostname: !Sub "${ApplicationId}-solr2-{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref ServicesEC2Size
Expand All @@ -240,7 +240,7 @@ Resources:
- Fn::ImportValue: !Ref SolrLayerID
StackId:
Fn::ImportValue: !Ref OpsWorksStackID
{% if item.tags["PowerManaged"] == "Yes" %}
{% if item.tags["PowerManaged"] == "Yes" %}
AutoScalingType: timer
# Monday-Friday 06:00-20:00 GMT+10
TimeBasedAutoScaling:
Expand All @@ -264,13 +264,13 @@ Resources:
{% endif %}

#web1
OpswxEC2Web1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}:
OpswxEC2Web1{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}:
Type: AWS::OpsWorks::Instance
DependsOn:
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}

Properties:
Hostname: !Sub "${ApplicationId}-web1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}"
Hostname: !Sub "${ApplicationId}-web1-{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref WebEC2Size
Expand Down Expand Up @@ -301,16 +301,18 @@ Resources:
{% endfor %}
{% endif %}

#OpswxEC2Web2PM ~ OpswxEC2Web6PM
#OpswxEC2Web2AO ~ OpswxEC2Web6AO
{% set subnetLetters = ["C","A","B"] %}
{% for loopingTimes in range(2, 7) %}
OpswxEC2Web{{ loopingTimes }}{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AlwaysOn{% endif %}:
OpswxEC2Web{{ loopingTimes }}{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}:
Condition: {{ loopingTimes }}PlusWebInstances
DependsOn:
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}

Type: AWS::OpsWorks::Instance
Properties:
Hostname: !Sub "${ApplicationId}-web{{ loopingTimes }}{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}"
Hostname: !Sub "${ApplicationId}-web{{ loopingTimes }}-{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref WebEC2Size
Expand Down Expand Up @@ -348,14 +350,14 @@ Resources:


#legacy load servers
OpswxEC2Web3:
OpswxEC2Web1Load:
Type: AWS::OpsWorks::Instance
DependsOn:
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}

Properties:
AutoScalingType: load
Hostname: !Sub "${ApplicationId}-web1a"
Hostname: !Sub "${ApplicationId}-web1-load"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref WebEC2Size
Expand All @@ -364,14 +366,14 @@ Resources:
StackId:
Fn::ImportValue: !Ref OpsWorksStackID

OpswxEC2Web4:
OpswxEC2Web2Load:
Condition: 2PlusWebInstances
Type: AWS::OpsWorks::Instance
DependsOn:
- OpswxEC2Web3
- OpswxEC2Web1Load
Properties:
AutoScalingType: load
Hostname: !Sub "${ApplicationId}-web2a"
Hostname: !Sub "${ApplicationId}-web2-load"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref WebEC2Size
Expand All @@ -383,15 +385,15 @@ Resources:
Fn::ImportValue: !Ref OpsWorksStackID


OpswxEC2Batch2:
OpswxEC2Batch1Load:
Condition: BatchLayerNeeded
DependsOn:
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}

Type: AWS::OpsWorks::Instance
Properties:
AutoScalingType: load
Hostname: !Sub "${ApplicationId}-batch1a"
Hostname: !Sub "${ApplicationId}-batch1-load"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref BatchEC2Size
Expand All @@ -400,17 +402,17 @@ Resources:
StackId:
Fn::ImportValue: !Ref OpsWorksStackID

#OpswxEC2Batch1PowerManaged ~ OpswxEC2Batch6PowerManaged
#OpswxEC2Batch1AlwaysOn ~ OpswxEC2Batch6AlwaysOn
#OpswxEC2Batch1PM ~ OpswxEC2Batch6PM
#OpswxEC2Batch1AO ~ OpswxEC2Batch6AO
{% for loopingTimes in range(1, 7) %}
OpswxEC2Batch{{ loopingTimes }}{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AlwaysOn{% endif %}:
OpswxEC2Batch{{ loopingTimes }}{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}:
Condition: {{ loopingTimes }}PlusBatchInstances
DependsOn:
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% endif %}
- OpswxEC2Services1{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}

Type: AWS::OpsWorks::Instance
Properties:
Hostname: !Sub "${ApplicationId}-{% if item.tags["PowerManaged"] == "Yes" %}PM-{% else %}AO-{% endif %}batch{{ loopingTimes }}"
Hostname: !Sub "${ApplicationId}-batch{{ loopingTimes }}-{% if item.tags["PowerManaged"] == "Yes" %}PM{% else %}AO{% endif %}"
RootDeviceType: ebs
InstallUpdatesOnBoot: true
InstanceType: !Ref BatchEC2Size
Expand Down

0 comments on commit 4455705

Please sign in to comment.