sborenst
2017-11-01 bc1ba6f0eb6feec5f877ea84d2c7f516dd466588
fixed issues with three-tier-app
2 files modified
55 ■■■■ changed files
ansible/configs/three-tier-app/env_vars.yml 7 ●●●●● patch | view | raw | blame | history
ansible/configs/three-tier-app/files/cloud_providers/ec2_cloud_template.j2 48 ●●●● patch | view | raw | blame | history
ansible/configs/three-tier-app/env_vars.yml
@@ -82,12 +82,14 @@
appdb_instance_count: 1
support_instance_count: 1
instances:
  - name: "frontend"
    count: "{{frontend_instance_count}}"
    public_dns: true
    loadbalancer: true
    ansible_group: ac
    ansible_group: frontends
    flavor:
      "ec2": "{{frontend_instance_type}}"
    tags:
@@ -96,10 +98,9 @@
      - key: "Project"
        value: "{{project_tag}}"
      - key: "ostype"
        value: "frontend"
        value: "linux"
      - key: "owner"
        value: "{{ email | default(unknownuser) }}"
  - name: "app"
    count: "{{app_instance_count}}"
    public_dns: true
ansible/configs/three-tier-app/files/cloud_providers/ec2_cloud_template.j2
@@ -174,31 +174,6 @@
        - "Fn::GetAtt":
          - Bastion
          - PublicIp
{% for instance in instances %}
{% if instance['loadbalancer'] is defined %}
   {{instance['name']}}DNSLoadBalancer:
    Type: "AWS::Route53::RecordSetGroup"
    DependsOn: {{instance['name']}}{{instance['count']}}EIP
    Properties:
     HostedZoneId: {{HostedZoneId}}
     RecordSets:
      - Name: "{{instance['name']}}.{{subdomain_base}}."
        Type: A
        TTL: 900
        ResourceRecords:
{% for c in range(1,(instance['count'] |int)+1) %}
{% set instancecount = loop %}
          - "Fn::GetAtt":
            - {{instance['name']}}{{loop.index}}
            - PublicIp
{% endfor %}
{% endif %}
{% endfor %}
   Bastion:
    Type: "AWS::EC2::Instance"
    Properties:
@@ -250,6 +225,29 @@
          - PrivateIp
{% for instance in instances %}
{% if instance['loadbalancer'] is defined %}
   {{instance['name']}}DNSLoadBalancer:
    Type: "AWS::Route53::RecordSetGroup"
    DependsOn: {{instance['name']}}{{instance['count']}}EIP
    Properties:
     HostedZoneId: {{HostedZoneId}}
     RecordSets:
      - Name: "{{instance['name']}}.{{subdomain_base}}."
        Type: A
        TTL: 900
        ResourceRecords:
{% for c in range(1,(instance['count'] |int)+1) %}
{% set instancecount = loop %}
          - "Fn::GetAtt":
            - {{instance['name']}}{{loop.index}}
            - PublicIp
{% endfor %}
{% endif %}
{% endfor %}
{% for instance in instances %}
{% for c in range(1,(instance['count'] |int)+1) %}