diff --git a/ansible/configs/vld-pattern-base-binder/README.adoc b/ansible/configs/vld-pattern-base-binder/README.adoc deleted file mode 100644 index ca9b21ae511..00000000000 --- a/ansible/configs/vld-pattern-base-binder/README.adoc +++ /dev/null @@ -1,37 +0,0 @@ -== Overview - -*vld-pattern-base-binder* _config_ is used to do cross-cluster tasks -after all sub-components have been deployed - -== Supported Cloud Providers - -No cloud providers have been configured because this env_type is not meant to deploy resources, only interact with already available resources. - -== Review the Env_Type variable file - -For further information on customizing images consult the link:../../../docs/Creating_a_config.adoc[Creating a Config Guide] - -== Review the `sample_vars.yml` variable file - ----- - ---- -guid: test-config-00 -env_type: vld-pattern-base-binder -cloud_provider: none -... - ----- - -== Developing with `vld-pattern-base-binder` - -You should get a file of "extra-vars" from the AnarchySubject of this base component. - -Find the AnarchySubject for this component and copy out the appropriate job data into a local yaml file on your laptop. -You might call it `my_sample_vars.yaml` - -While developing, you can deploy this config by running the following command from the `ansible` -directory. - -`ansible-playbook main.yml -e @my_sample_vars.yaml -e @configs/vld-pattern-base-binder/sample_vars.yml` - diff --git a/ansible/configs/vld-pattern-base-binder/default_vars.yml b/ansible/configs/vld-pattern-base-binder/default_vars.yml deleted file mode 100644 index 6cfd23bc489..00000000000 --- a/ansible/configs/vld-pattern-base-binder/default_vars.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -env_type: vld-pattern-base-binder -cloud_provider: none - diff --git a/ansible/configs/vld-pattern-base-binder/default_vars_ec2.yml b/ansible/configs/vld-pattern-base-binder/default_vars_ec2.yml deleted file mode 100644 index dd16960f718..00000000000 --- a/ansible/configs/vld-pattern-base-binder/default_vars_ec2.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# mandatory to run ansible/destroy.yml playbook -aws_region: us-east-1 diff --git a/ansible/configs/vld-pattern-base-binder/destroy_env.yml b/ansible/configs/vld-pattern-base-binder/destroy_env.yml deleted file mode 100644 index cc4d96ecb3c..00000000000 --- a/ansible/configs/vld-pattern-base-binder/destroy_env.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Destroy playbook - hosts: localhost - connection: local - gather_facts: false - become: false - tasks: - - - name: Entering the vld-pattern-base-binder destroy.yml - debug: - msg: - - Entering the destroy.yml - - - - name: Exiting the vld-pattern-base-binder destroy.yml - debug: - msg: - - Exiting the destroy.yml -... diff --git a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/azure_cloud_template.j2 b/ansible/configs/vld-pattern-base-binder/files/cloud_providers/azure_cloud_template.j2 deleted file mode 100644 index 7f92c644d17..00000000000 --- a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/azure_cloud_template.j2 +++ /dev/null @@ -1,428 +0,0 @@ -{ - "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters" : { - "guid": { - "type" : "string", - "minLength" : 3, - "metadata" : { - "description" : "GUID of the environment" - } - }, - "DNSZone": { - "type" : "string", - "minLength" : 3, - "metadata" : { - "description" : "dns zone of the environment, to update or create" - } - }, - "adminUsername" : { - "type" : "string", - "minLength" : 1, - "defaultValue" : "azure", - "metadata" : { - "description" : "User name for the Virtual Machine." - } - }, - "sshKeyData" : { - "type" : "securestring", - "metadata" : { - "description" : "SSH RSA public key file as a string." - } - }, - "vmSize" : { - "type" : "string", - "defaultValue" : "Basic_A2", - "allowedValues" : [ - "Basic_A2", - "Standard_A2", - "Standard_A3", - "Standard_A4", - "Standard_A5", - "Standard_A6", - "Standard_A7", - "Standard_A8", - "Standard_A9", - "Standard_A10", - "Standard_A11", - "Standard_D2", - "Standard_D3", - "Standard_D4", - "Standard_D11", - "Standard_D12", - "Standard_D13", - "Standard_D14", - "Standard_D2_v2", - "Standard_D3_v2", - "Standard_D4_v2", - "Standard_D5_v2", - "Standard_D11_v2", - "Standard_D12_v2", - "Standard_D13_v2", - "Standard_D14_v2", - "Standard_G1", - "Standard_G2", - "Standard_G3", - "Standard_G4", - "Standard_G5", - "Standard_DS2", - "Standard_DS3", - "Standard_DS4", - "Standard_DS11", - "Standard_DS12", - "Standard_DS13", - "Standard_DS14", - "Standard_DS2_v2", - "Standard_DS3_v2", - "Standard_DS4_v2", - "Standard_DS5_v2", - "Standard_DS11_v2", - "Standard_DS12_v2", - "Standard_DS13_v2", - "Standard_DS14_v2", - "Standard_GS1", - "Standard_GS2", - "Standard_GS3", - "Standard_GS4", - "Standard_GS5" - ], - "metadata" : { - "description" : "The size of the each Node Virtual Machine." - } - } - }, - "variables" : { - "subzone": "[concat('{{guid}}.',parameters('DNSZone'))]", - "location" : "[resourceGroup().location]", - "virtualNetworkName" : "[concat('VNet', parameters('guid'))]", - "addressPrefix" : "10.0.0.0/16", - "vnetId" : "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", - "rhel" : { - "publisher" : "Redhat", - "offer" : "RHEL", - "sku" : "7-RAW", - "version" : "latest" - }, - "tenantId" : "[subscription().tenantId]", - "apiVersion" : "2015-06-15", - "apiVersionCompute" : "2015-06-15", - "apiVersionNetwork" : "2016-03-30", - "tmApiVersion" : "2015-11-01", - "apiVersionStorage" : "2015-06-15", - "apiVersionLinkTemplate" : "2015-01-01", - "nicName" : "OneVmNic", - "publicIPAddressType" : "Dynamic", - "subnetRef" : "[concat(variables('vnetID'),'/subnets/',variables('virtualNetworkName'))]", - "sshKeyPath" : "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", - "sQuote" : "\"", - "vmStorageAccountContainerName": "vhds", - "storageAccountType": "Standard_LRS", - "vhdStorageType" : "Premium_LRS", - "storageAccountName": "[concat('vsts8',uniquestring(parameters('guid')))]" - }, - "resources": [ - { - "type": "Microsoft.Storage/storageAccounts", - "name": "[variables('StorageAccountName')]", - "apiVersion": "2016-01-01", - "location": "[resourceGroup().location]", - "sku": { - "name": "[variables('storageAccountType')]" - }, - "kind": "Storage", - "properties": { - } - }, -{% for instance in instances %} - -{% if instance['dns_loadbalancer']|d(false)|bool and not instance['unique']|d(false)|bool %} - { - "type": "Microsoft.Network/dnszones/a", - "name": "[concat(variables('subzone'), '/', '{{instance['name']}}')]", - "apiVersion": "2016-04-01", - "dependsOn": [ -{% for c in range(1,(instance['count'] |int)+1) %} - {% if instance['unique']|d(false)|bool %} - {% set instancename = instance['name'] %} - {% else %} - {% set instancename = instance['name'] + (loop.index|string) %} - {% endif %} - "[resourceId('Microsoft.Network/publicIPAddresses/', '{{instancename}}-PublicIP')]", -{% endfor %} - "[resourceId('Microsoft.Network/dnsZones/', variables('subzone'))]", - ], - "properties": { - "TTL": 3600, - "ARecords": [ - { -{% for c in range(1,(instance['count'] |int)+1) %} - {% if instance['unique']|d(false)|bool %} - {% set instancename = instance['name'] %} - {% else %} - {% set instancename = instance['name'] + (loop.index|string) %} - {% endif %} - "ipv4Address": "[reference('{{instancename}}-PublicIP').ipAddress]" -{% endfor %} - } - ] - } - }, -{% endif %} - - -{% for c in range(1,(instance['count'] |int)+1) %} - - {% if instance['unique']|d(false)|bool %} - {% set instancename = instance['name'] %} - {% else %} - {% set instancename = instance['name'] + (loop.index|string) %} - {% endif %} - -{% if instance['public_dns']|d(false)|bool %} - { - "type": "Microsoft.Network/dnszones/a", - "name": "[concat(variables('subzone'), '/', '{{instancename}}')]", - "apiVersion": "2016-04-01", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses/', '{{instancename}}-PublicIP')]", - "[resourceId('Microsoft.Network/dnsZones/', variables('subzone'))]", - ], - "properties": { - "TTL": 3600, - "ARecords": [ - { - "ipv4Address": "[reference('{{instancename}}-PublicIP').ipAddress]" - } - ] - } - }, - { - "apiVersion" : "2017-04-01", - "type" : "Microsoft.Network/publicIPAddresses", - "name" : "{{instancename}}-PublicIP", - "location" : "[resourceGroup().location]", - "properties" : { - "publicIPAllocationMethod" : "Static", - "dnsSettings" : { - "domainNameLabel" : "{{instancename}}-{{guid}}" - } - } - }, - { - "apiVersion" : "2017-04-01", - "type" : "Microsoft.Network/networkInterfaces", - "name" : "{{instancename}}-Interface", - "location" : "[resourceGroup().location]", - "dependsOn" : [ - "[resourceId('Microsoft.Network/publicIPAddresses/', '{{instancename}}-PublicIP')]", - "[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" - ], - "properties" : { - "ipConfigurations" : [ - { - "name" : "ipconfig1", - "properties" : { - "privateIPAllocationMethod" : "Dynamic", - "publicIPAddress" : { - "id" : "[resourceId('Microsoft.Network/publicIPAddresses','{{instancename}}-PublicIP')]" - }, - "subnet" : { - "id" : "[variables('subnetRef')]" - } - } - } - ] - } - }, -{% endif %} - { - "apiVersion" : "2017-03-30", - "type" : "Microsoft.Compute/virtualMachines", - "name" : "{{instancename}}", - "location" : "[resourceGroup().location]", - "dependsOn" : [ - "[resourceId('Microsoft.Network/networkInterfaces/', '{{instancename}}-Interface')]" - ], - "tags": { - "Name": "{{instancename}}", - "internaldns": "{{instancename}}.{{chomped_zone_internal_dns}}", - "owner": "{{ email | default('unknownuser') }}", - "Project": "{{project_tag}}", -{% for tag in instance['tags'] %} - "{{tag['key']}}": "{{tag['value']}}", -{% endfor %} - "{{project_tag}}": "{{ instance['name'] }}" - }, - "properties" : { - "hardwareProfile" : { - "vmSize" : "{{instance['flavor'][cloud_provider]}}" - }, - "osProfile" : { - "computerName" : "{{instancename}}", - "adminUsername" : "[parameters('adminUsername')]", - "linuxConfiguration" : { - "disablePasswordAuthentication" : "true", - "ssh" : { - "publicKeys" : [ - { - "path" : "[variables('sshKeyPath')]", - "keyData" : "[parameters('sshKeyData')]" - } - ] - } - } - }, - "storageProfile" : { - "imageReference" : "[variables('rhel')]", - "osDisk" : { - "caching" : "ReadWrite", - "name" : "{{instancename}}-osdisk", - "createOption" : "FromImage", - "diskSizeGB" : "{{instance['rootfs_size']|d('50')}}" - }, - "dataDisks" : [ -{% for vol in instance['volumes']|default([]) %} - { - "caching" : "None", - "createOption" : "Empty", - "lun" : "{{loop.index}}", - "name": "{{instancename}}-{{vol['device_name']}}", - "diskSizeGB" : "{{vol['volume_size']}}" - }, -{% endfor %} - ] - }, - "networkProfile" : { - "networkInterfaces" : [ - { - "id" : "[resourceId('Microsoft.Network/networkInterfaces','{{instancename}}-Interface')]" - } - ] - }, - "diagnosticsProfile" : { - "bootDiagnostics" : { - "enabled" : "false", - "storageUri" : "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), '2016-01-01').primaryEndpoints.blob)]" - } - } - } - }, -{% endfor %} -{% endfor %} - { - "name": "[variables('subzone')]", - "type": "Microsoft.Network/dnsZones", - "apiVersion": "2017-09-01", - "location" : "global", - }, - { - "apiVersion": "2017-05-10", - "name": "nestedTemplate", - "type": "Microsoft.Resources/deployments", - "resourceGroup": "dns", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "variables": {}, - "resources": [ - ] - }, - "parameters": {} - } - }, - { - "apiVersion" : "[variables('apiVersion')]", - "type" : "Microsoft.Network/virtualNetworks", - "name" : "[variables('virtualNetworkName')]", - "location" : "[variables('location')]", - "tags" : { - "displayName" : "VirtualNetwork" - }, - "properties" : { - "addressSpace" : { - "addressPrefixes" : [ - "[variables('addressPrefix')]" - ] - }, - "subnets" : [ - { - "name" : "[variables('virtualNetworkName')]", - "properties" : { - "addressPrefix" : "[variables('addressPrefix')]" - } - } - ] - } - }, - { - "type" : "Microsoft.Network/networkSecurityGroups", - "name" : "[concat(resourceGroup().name, 'nsg')]", - "tags" : { - "displayName" : "NetworkSecurityGroup" - }, - "apiVersion" : "[variables('apiVersion')]", - "location" : "[resourceGroup().location]", - "properties" : { - "securityRules" : [ - { - "name" : "default-allow-openshift-router-https", - "properties" : { - "protocol" : "Tcp", - "sourcePortRange" : "*", - "destinationPortRange" : "443", - "sourceAddressPrefix" : "*", - "destinationAddressPrefix" : "*", - "access" : "Allow", - "priority" : 2000, - "direction" : "Inbound" - } - }, - { - "name" : "default-allow-openshift-router-http\n", - "properties" : { - "protocol" : "Tcp", - "sourcePortRange" : "*", - "destinationPortRange" : "80", - "sourceAddressPrefix" : "*", - "destinationAddressPrefix" : "*", - "access" : "Allow", - "priority" : 2001, - "direction" : "Inbound" - } - }, - { - "name" : "default-allow-openshift-master", - "properties" : { - "protocol" : "Tcp", - "sourcePortRange" : "*", - "destinationPortRange" : "8443", - "sourceAddressPrefix" : "*", - "destinationAddressPrefix" : "*", - "access" : "Allow", - "priority" : 2002, - "direction" : "Inbound" - } - }, - { - "name" : "default-allow-ssh", - "properties" : { - "protocol" : "Tcp", - "sourcePortRange" : "*", - "destinationPortRange" : "22", - "sourceAddressPrefix" : "*", - "destinationAddressPrefix" : "*", - "access" : "Allow", - "priority" : 2003, - "direction" : "Inbound" - } - } - ] - } - } - ], - "outputs" : { - } -} diff --git a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/ec2_cloud_template.j2 b/ansible/configs/vld-pattern-base-binder/files/cloud_providers/ec2_cloud_template.j2 deleted file mode 100644 index ae94a8e52aa..00000000000 --- a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/ec2_cloud_template.j2 +++ /dev/null @@ -1,286 +0,0 @@ -AWSTemplateFormatVersion: "2010-09-09" -Mappings: - RegionMapping: - us-east-1: - RHELAMI: ami-c998b6b2 - WIN2012R2AMI: ami-0dcdd073eeabb0101 - us-east-2: - RHELAMI: ami-cfdafaaa - WIN2012R2AMI: ami-72745d17 - us-west-1: - RHELAMI: ami-66eec506 - WIN2012R2AMI: ami-ef95ae8f - us-west-2: - RHELAMI: ami-9fa343e7 - WIN2012R2AMI: ami-af5980d7 - eu-west-1: - RHELAMI: ami-bb9a6bc2 - WIN2012R2AMI: ami-24f04d5d - eu-west-2: - WIN2012R2AMI: ami-6a746a0e - ca-central-1: - WIN2012R2AMI: ami-4e4cf72a - eu-central-1: - RHELAMI: ami-d74be5b8 - WIN2012R2AMI: ami-88c14ee7 - ap-northeast-1: - RHELAMI: ami-30ef0556 - WIN2012R2AMI: ami-dcdd66ba - ap-northeast-2: - RHELAMI: ami-0f5a8361 - WIN2012R2AMI: ami-681cbb06 - ap-southeast-1: - RHELAMI: ami-10bb2373 - WIN2012R2AMI: ami-f887d59b - ap-southeast-2: - RHELAMI: ami-ccecf5af - WIN2012R2AMI: ami-f601f494 - sa-east-1: - RHELAMI: ami-a789ffcb - WIN2012R2AMI: ami-42a5e12e - ap-south-1: - RHELAMI: ami-cdbdd7a2 - WIN2012R2AMI: ami-b9e8a6d6 - DNSMapping: - us-east-1: - domain: us-east-1.compute.internal - us-west-1: - domain: us-west-1.compute.internal - us-west-2: - domain: us-west-2.compute.internal - eu-west-1: - domain: eu-west-1.compute.internal - eu-central-1: - domain: eu-central-1.compute.internal - ap-northeast-1: - domain: ap-northeast-1.compute.internal - ap-northeast-2: - domain: ap-northeast-2.compute.internal - ap-southeast-1: - domain: ap-southeast-1.compute.internal - ap-southeast-2: - domain: ap-southeast-2.compute.internal - sa-east-1: - domain: sa-east-1.compute.internal - ap-south-1: - domain: ap-south-1.compute.internal -Resources: - Vpc: - Type: "AWS::EC2::VPC" - Properties: - CidrBlock: "192.168.0.0/16" - EnableDnsSupport: true - EnableDnsHostnames: true - Tags: - - Key: Name - Value: "{{ vpcid_name_tag }}" - - Key: Hostlication - Value: - Ref: "AWS::StackId" - VpcInternetGateway: - Type: "AWS::EC2::InternetGateway" - VpcGA: - Type: "AWS::EC2::VPCGatewayAttachment" - Properties: - InternetGatewayId: - Ref: VpcInternetGateway - VpcId: - Ref: Vpc - VpcRouteTable: - Type: "AWS::EC2::RouteTable" - Properties: - VpcId: - Ref: Vpc - VPCRouteInternetGateway: - DependsOn: VpcGA - Type: "AWS::EC2::Route" - Properties: - GatewayId: - Ref: VpcInternetGateway - DestinationCidrBlock: "0.0.0.0/0" - RouteTableId: - Ref: VpcRouteTable - PublicSubnet: - Type: "AWS::EC2::Subnet" - DependsOn: - - Vpc - Properties: - CidrBlock: "192.168.0.0/24" - Tags: - - Key: Name - Value: "{{ project_tag }}" - - Key: Hostlication - Value: - Ref: "AWS::StackId" - MapPublicIpOnLaunch: true - VpcId: - Ref: Vpc - PublicSubnetRTA: - Type: "AWS::EC2::SubnetRouteTableAssociation" - Properties: - RouteTableId: - Ref: VpcRouteTable - SubnetId: - Ref: PublicSubnet - HostSG: - Type: "AWS::EC2::SecurityGroup" - Properties: - GroupDescription: Host - VpcId: - Ref: Vpc - Tags: - - Key: Name - Value: host_sg - HostUDPPorts: - Type: "AWS::EC2::SecurityGroupIngress" - Properties: - GroupId: - "Fn::GetAtt": - - HostSG - - GroupId - IpProtocol: udp - FromPort: 0 - ToPort: 65535 - CidrIp: "0.0.0.0/0" - HostTCPPorts: - Type: "AWS::EC2::SecurityGroupIngress" - Properties: - GroupId: - "Fn::GetAtt": - - HostSG - - GroupId - IpProtocol: tcp - FromPort: 0 - ToPort: 65535 - CidrIp: "0.0.0.0/0" - zoneinternalidns: - Type: "AWS::Route53::HostedZone" - Properties: - Name: "{{ zone_internal_dns }}" - VPCs: - - VPCId: - Ref: Vpc - VPCRegion: - Ref: "AWS::Region" - HostedZoneConfig: - Comment: "Created By ansible agnostic deployer" - -{% for instance in instances %} -{% if instance['dns_loadbalancer'] | default(false) | bool and not instance['unique'] | default(false) | bool %} - {{instance['name']}}DNSLoadBalancer: - Type: "AWS::Route53::RecordSetGroup" - DependsOn: -{% for c in range(1,(instance['count'] |int)+1) %} - - {{ instance['name'] }}{{ c }}EIP -{% endfor %} - Properties: - HostedZoneId: {{ HostedZoneId }} - RecordSets: - - Name: "{{ instance['name'] }}.{{ subdomain_base }}." - Type: A - TTL: 900 - ResourceRecords: -{% for c in range(1,(instance['count'] | int)+1) %} - - "Fn::GetAtt": - - {{ instance['name'] }}{{ loop.index }} - - PublicIp -{% endfor %} -{% endif %} - -{% for c in range(1,(instance['count'] | int)+1) %} - {{ instance['name'] }}{{ loop.index }}: - Type: "AWS::EC2::Instance" - Properties: - ImageId: - "Fn: : FindInMap": - - RegionMapping - - Ref: "AWS::Region" - - {{ instance['image_id'] | default('RHELAMI') }} - - InstanceType: "{{ instance['flavor'][cloud_provider] }}" - KeyName: "{{ instance['key_name'] | default(key_name) }}" -{% if instance['UserData'] is defined %} - {{ instance['UserData'] }} -{% endif %} - SecurityGroupIds: - - "Fn::GetAtt": - - HostSG - - GroupId - SubnetId: - Ref: PublicSubnet - Tags: -{% if instance['unique'] | default(false) | bool %} - - Key: Name - Value: {{ instance['name'] }} - - Key: internaldns - Value: {{ instance['name'] }}.{{ chomped_zone_internal_dns }} -{% else %} - - Key: Name - Value: {{ instance['name'] }}{{ loop.index }} - - Key: internaldns - Value: {{ instance['name'] }}{{ loop.index }}.{{ chomped_zone_internal_dns }} -{% endif %} - - Key: "owner" - Value: "{{ email | default('unknownuser') }}" - - Key: "Project" - Value: "{{ project_tag }}" - - Key: "{{ project_tag }}" - Value: "{{ instance['name'] }}" -{% for tag in instance['tags'] %} - - Key: {{ tag['key'] }} - Value: {{ tag['value'] }} -{% endfor %} - BlockDeviceMappings: - - DeviceName: "/dev/sda1" - Ebs: - VolumeSize: 50 - - DeviceName: "/dev/xvdb" - Ebs: - VolumeType: gp2 - VolumeSize: 20 - {{ instance['name'] }}{{ loop.index }}InternalDNS: - Type: "AWS::Route53::RecordSetGroup" - Properties: - HostedZoneId: - Ref: zoneinternalidns - RecordSets: -{% if instance['unique'] | default(false) | bool %} - - Name: "{{ instance['name'] }}.{{ zone_internal_dns }}" -{% else %} - - Name: "{{ instance['name'] }}{{ loop.index }}.{{ zone_internal_dns }}" -{% endif %} - Type: A - TTL: 10 - ResourceRecords: - - "Fn::GetAtt": - - {{ instance['name'] }}{{ loop.index }} - - PrivateIp -{% if instance['public_dns'] %} - {{ instance['name'] }}{{ loop.index }}EIP: - Type: "AWS::EC2::EIP" - DependsOn: - - VpcGA - Properties: - InstanceId: - Ref: {{ instance['name'] }}{{ loop.index }} - {{ instance['name'] }}{{ loop.index }}PubliclDNS: - Type: "AWS::Route53::RecordSetGroup" - DependsOn: - - {{ instance['name'] }}{{ loop.index }}EIP - Properties: - HostedZoneId: {{ HostedZoneId }} - RecordSets: -{% if instance['unique'] | default(false) | bool %} - - Name: "{{ instance['name'] }}.{{ subdomain_base }}." -{% else %} - - Name: "{{ instance['name'] }}{{ loop.index }}.{{ subdomain_base }}." -{% endif %} - Type: A - TTL: 10 - ResourceRecords: - - "Fn::GetAtt": - - {{ instance['name'] }}{{ loop.index }} - - PublicIp -{% endif %} -{% endfor %} -{% endfor %} diff --git a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/ec2_cloud_template_json.j2 b/ansible/configs/vld-pattern-base-binder/files/cloud_providers/ec2_cloud_template_json.j2 deleted file mode 100644 index a7664959f8c..00000000000 --- a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/ec2_cloud_template_json.j2 +++ /dev/null @@ -1,783 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Parameters": {}, - "Mappings": { - "RegionMapping": { - "us-east-1": { - "RHELAMI": "ami-b63769a1", "WIN2012R2AMI": "ami-7da4ab6b" - }, - "us-east-2": { - "RHELAMI": "ami-0932686c", "WIN2012R2AMI": "ami-ffae8f9a" - }, - "us-west-1": { - "RHELAMI": "ami-2cade64c", "WIN2012R2AMI": "ami-a11836c1" - }, - "us-west-2": { - "RHELAMI": "ami-6f68cf0f", "WIN2012R2AMI": "ami-a1c1ddd8" - }, - "eu-west-1": { - "RHELAMI": "ami-02ace471", "WIN2012R2AMI": "ami-cc8e98a8" - }, - "eu-central-1": { - "RHELAMI": "ami-e4c63e8b", "WIN2012R2AMI": "ami-da1ebdb5" - }, - "ap-northeast-1": { - "RHELAMI": "ami-5de0433c", "WIN2012R2AMI": "ami-4312cc2d" - }, - "ap-northeast-2": { - "RHELAMI": "ami-44db152a", "WIN2012R2AMI": "ami-68756f0f" - }, - "ap-southeast-1": { - "RHELAMI": "ami-2c95344f", "WIN2012R2AMI": "ami-7644d315" - }, - "ap-southeast-2": { - "RHELAMI": "ami-39ac915a", "WIN2012R2AMI": "ami-468f9225" - }, - "sa-east-1": { - "RHELAMI": "ami-7de77b11", "WIN2012R2AMI": "ami-c8285ca4" - }, - "ap-south-1": { - "RHELAMI": "ami-cdbdd7a2", "WIN2012R2AMI": "ami-8eafd6e1" - } - }, - "DNSMapping": { - "us-east-1": { - "domain": "us-east-1.compute.internal" - }, - "us-west-1": { - "domain": "us-west-1.compute.internal" - }, - "us-west-2": { - "domain": "us-west-2.compute.internal" - }, - "eu-west-1": { - "domain": "eu-west-1.compute.internal" - }, - "eu-central-1": { - "domain": "eu-central-1.compute.internal" - }, - "ap-northeast-1": { - "domain": "ap-northeast-1.compute.internal" - }, - "ap-northeast-2": { - "domain": "ap-northeast-2.compute.internal" - }, - "ap-southeast-1": { - "domain": "ap-southeast-1.compute.internal" - }, - "ap-southeast-2": { - "domain": "ap-southeast-2.compute.internal" - }, - "sa-east-1": { - "domain": "sa-east-1.compute.internal" - }, - "ap-south-1": { - "domain": "ap-south-1.compute.internal" - } - } - }, - "Resources": { - "Vpc": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "192.168.0.0/16", - "EnableDnsSupport": "true", - "EnableDnsHostnames": "true", - "Tags": [ - { - "Key": "Name", - "Value": "{{ vpcid_name_tag }}" - }, - { - "Key": "Hostlication", - "Value": { - "Ref": "AWS::StackId" - } - } - ] - } - }, - "VpcInternetGateway": { - "Type": "AWS::EC2::InternetGateway", - "Properties": {} - }, - "VpcGA": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "InternetGatewayId": { - "Ref": "VpcInternetGateway" - }, - "VpcId": { - "Ref": "Vpc" - } - } - }, - "VpcRouteTable": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Vpc" - } - } - }, - "VPCRouteInternetGateway": { - "DependsOn" : "VpcGA", - "Type": "AWS::EC2::Route", - "Properties": { - "GatewayId": { - "Ref": "VpcInternetGateway" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "RouteTableId": { - "Ref": "VpcRouteTable" - } - } - }, - "PublicSubnet": { - "Type": "AWS::EC2::Subnet", - "DependsOn": [ - "Vpc" - ], - "Properties": { - "CidrBlock": "192.168.0.0/24", - "Tags": [ - { - "Key": "Name", - "Value": "{{project_tag}}" - }, - { - "Key": "Hostlication", - "Value": { - "Ref": "AWS::StackId" - } - } - ], - "MapPublicIpOnLaunch": "true", - "VpcId": { - "Ref": "Vpc" - } - } - }, - "PublicSubnetRTA": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcRouteTable" - }, - "SubnetId": { - "Ref": "PublicSubnet" - } - } - }, - "HostSG": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Host", - "VpcId": { - "Ref": "Vpc" - }, - "Tags": [ - { - "Key": "Name", - "Value": "host_sg" - } - ] - } - }, - "HostUDPPorts": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "GroupId": { - "Fn::GetAtt": [ - "HostSG", - "GroupId" - ] - }, - "IpProtocol": "udp", - "FromPort": "0", - "ToPort": "65535", - "CidrIp": "0.0.0.0/0" - } - }, - "HostTCPPorts": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "GroupId": { - "Fn::GetAtt": [ - "HostSG", - "GroupId" - ] - }, - "IpProtocol": "tcp", - "FromPort": "0", - "ToPort": "65535", - "CidrIp": "0.0.0.0/0" - } - }, - "zoneinternalidns": { - "Type": "AWS::Route53::HostedZone", - "Properties": { - "Name": "{{ zone_internal_dns }}", - "VPCs" : [{ - "VPCId": { "Ref" : "Vpc" }, - "VPCRegion": { "Ref": "AWS::Region" } } ], - "HostedZoneConfig": { - "Comment": "Created By ansible agnostic deployer" - } - } - }, - "BastionDNS": { - "Type": "AWS::Route53::RecordSetGroup", - "DependsOn": [ "BastionEIP" ], - "Properties": { - "HostedZoneId": "{{ HostedZoneId }}", - "RecordSets": [ - { - "Name": "{{ bastion_public_dns }}", - "Type": "A", - "TTL": "10", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "Bastion", - "PublicIp" - ] - } - ] - } - ] - } - }, - "CloudDNS": { - "Type": "AWS::Route53::RecordSetGroup", - "DependsOn": [ "BastionEIP" ], - "Properties": { - "HostedZoneId": "{{ HostedZoneId }}", - "RecordSets": [ - { - "Name": "{{ cloudapps_dns }}", - "Type": "A", - "TTL": "10", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "Bastion", - "PublicIp" - ] - } - ] - } - ] - } - }, - "FrontendDNSLoadBalancer": { - "Type": "AWS::Route53::RecordSetGroup", - "DependsOn": "frontend{{ frontend_instance_count }}EIP", - "Properties": { - "HostedZoneId": "{{ HostedZoneId }}", - "RecordSets": [ - { - "Name" : "{{ frontend_public_dns }}", - "Type" : "A", - "TTL" : "900", - "ResourceRecords" : [ -{% for c in range(1, frontend_instance_count | int) + 1) %} - { "Fn::GetAtt": ["frontend{{loop.index}}", "PublicIp"] }{% if not loop.last %},{% endif %} -{% endfor %} - ]}] - }}, -{% for c in range(1, frontend_instance_count | int) + 1) %} - "PublicHostDNS{{ loop.index }}": { - "Type": "AWS::Route53::RecordSetGroup", - "DependsOn": "frontend{{ frontend_instance_count }}EIP", - "Properties": { - "HostedZoneId": "{{ HostedZoneId }}", - "RecordSets": [ - { - "Name" : "frontend{{ loop.index }}.{{ subdomain_base }}.", - "Type" : "A", - "TTL" : "900", - "ResourceRecords" : [ - { "Fn::GetAtt": [ "frontend{{ loop.index }}", "PublicIp" ] } - ]}] - }}, -{% endfor %} - - "Bastion": { - "Type": "AWS::EC2::Instance", - "Properties": { - "ImageId": { - "Fn::FindInMap": [ - "RegionMapping", - { - "Ref": "AWS::Region" - }, - "RHELAMI" - ] - }, - "InstanceType": "{{ bastion_instance_type }}", - "KeyName": "{{ key_name }}", - "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [ - "#!/bin/bash -xe\n", - "sed -i '2i ldap_group_nesting_level=0' /etc/sssd/sssd.conf \n", - "systemctl restart sssd \n", - "echo 'PermitRootLogin without-password' >> /etc/ssh/sshd_config \n", - "sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config \n", - "sed -i 's/^ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config \n", - "systemctl restart sshd \n" - ]]}}, - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "HostSG", - "GroupId" - ] - } - ], - "SubnetId": { - "Ref": "PublicSubnet" - }, - "Tags": [ - { - "Key": "Name", - "Value": "bastion" - }, - { - "Key": "AnsibleGroup", - "Value": "bastions" - }, - { - "Key": "Project", - "Value": "{{ project_tag }}" - }, - { - "Key": "{{ project_tag }}", - "Value": "bastion" - }, - { - "Key": "internaldns", - "Value": "bastion.{{ chomped_zone_internal_dns }}" - }, - { - "Key": "owner", - "Value": "{{ email | default('unknown') }}" - } - ] - } - }, - "BastionEIP" : { - "Type" : "AWS::EC2::EIP", - "DependsOn": [ "VpcGA" ], - "Properties" : { - "InstanceId" : { "Ref" : "Bastion" } - } - }, - "BastionInternalDNS": { - "Type": "AWS::Route53::RecordSetGroup", - "Properties": { - "HostedZoneId" : { "Ref" : "zoneinternalidns" }, - "RecordSets": [ - { - "Name": "bastion.{{ zone_internal_dns }}", - "Type": "A", - "TTL": "10", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "Bastion", - "PrivateIp" - ] - } - ] - } - ] - } - }, -{% for c in range(1, (frontend_instance_count | int) + 1) %} - "frontend{{ loop.index }}": { - "Type": "AWS::EC2::Instance", - "Properties": { - "ImageId": { - "Fn::FindInMap": [ - "RegionMapping", - { - "Ref": "AWS::Region" - }, - "RHELAMI" - ] - }, - "InstanceType": "{{ frontend_instance_type }}", - "KeyName": "{{ key_name }}", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "HostSG", - "GroupId" - ] - } - ], - "SubnetId": { - "Ref": "PublicSubnet" - }, - "Tags": [ - { - "Key": "Name", - "Value": "frontend{{ loop.index }}" - }, - { - "Key": "AnsibleGroup", - "Value": "frontends" - }, - { - "Key": "Project", - "Value": "{{ project_tag }}" - }, - { - "Key": "{{ project_tag }}", - "Value": "frontend" - }, - { - "Key": "internaldns", - "Value": "frontend{{ loop.index }}.{{ chomped_zone_internal_dns }}" - }, - { - "Key": "owner", - "Value": "{{ email | default('unknown') }}" - } - ], - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "VolumeSize": 50 - } - }, - { - "DeviceName": "/dev/xvdb", - "Ebs": { - "VolumeType": "gp2", - "VolumeSize": 30 - } - } - ] - } - }, - "frontend{{ loop.index }}EIP" : { - "Type" : "AWS::EC2::EIP", - "DependsOn": [ "VpcGA" ], - "Properties" : { - "InstanceId" : { "Ref" : "frontend{{ loop.index }}" } - } - }, - "frontend{{ loop.index }}DNS": { - "Type": "AWS::Route53::RecordSetGroup", - "Properties": { - "HostedZoneId" : { "Ref" : "zoneinternalidns" }, - - "RecordSets": [ - { - "Name": "frontend{{ loop.index }}.{{ zone_internal_dns }}", - "Type": "A", - "TTL": "10", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "frontend{{ loop.index }}", - "PrivateIp" - ] - } - ] - } - ] - } - }, -{% endfor %} -{% for c in range(1, (app_instance_count | int) + 1) %} - "app{{ loop.index }}": { - "Type": "AWS::EC2::Instance", - "Properties": { - "ImageId": { - "Fn::FindInMap": [ - "RegionMapping", - { - "Ref": "AWS::Region" - }, - "RHELAMI" - ] - }, - "InstanceType": "{{ app_instance_type }}", - "KeyName": "{{ key_name }}", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "HostSG", - "GroupId" - ] - } - ], - "SubnetId": { - "Ref": "PublicSubnet" - }, - "Tags": [ - { - "Key": "Name", - "Value": "app{{ loop.index }}" - }, - { - "Key": "AnsibleGroup", - "Value": "apps" - }, - { - "Key": "Project", - "Value": "{{ project_tag }}" - }, - { - "Key": "{{ project_tag }}", - "Value": "app" - }, - { - "Key": "internaldns", - "Value": "app{{ loop.index }}.{{ chomped_zone_internal_dns }}" - }, - { - "Key": "owner", - "Value": "{{ email | default('unknown')}}" - } - ], - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "VolumeSize": 50 - } - }, - { - "DeviceName": "/dev/xvdb", - "Ebs": { - "VolumeType": "gp2", - "VolumeSize": 30 - } - } - ] - } - }, - - "app{{ loop.index }}DNS": { - "Type": "AWS::Route53::RecordSetGroup", - "Properties": { - "HostedZoneId" : { "Ref" : "zoneinternalidns" }, - - "RecordSets": [ - { - "Name": "app{{ loop.index }}.{{ zone_internal_dns }}", - "Type": "A", - "TTL": "10", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "app{{ loop.index }}", - "PrivateIp" - ] - } - ] - } - ] - } - }, -{% endfor %} - -{% for c in range(1, (appdb_instance_count | int) + 1) %} - "appdb{{ loop.index }}": { - "Type": "AWS::EC2::Instance", - "Properties": { - "ImageId": { - "Fn::FindInMap": [ - "RegionMapping", - { - "Ref": "AWS::Region" - }, - "RHELAMI" - ] - }, - "InstanceType": "{{ appdb_instance_type }}", - "KeyName": "{{ key_name }}", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "HostSG", - "GroupId" - ] - } - ], - "SubnetId": { - "Ref": "PublicSubnet" - }, - "Tags": [ - { - "Key": "Name", - "Value": "appdb{{ loop.index }}" - }, - { - "Key": "AnsibleGroup", - "Value": "appdbs" - }, - { - "Key": "Project", - "Value": "{{ project_tag }}" - }, - { - "Key": "{{ project_tag }}", - "Value": "appdb" - }, - { - "Key": "internaldns", - "Value": "appdb{{ loop.index }}.{{ chomped_zone_internal_dns }}" - }, - { - "Key": "owner", - "Value": "{{ email | default('unknown')}}" - } - ], - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "VolumeSize": 50 - } - }, - { - "DeviceName": "/dev/xvdb", - "Ebs": { - "VolumeType": "gp2", - "VolumeSize": 30 - } - } - ] - } - }, - - "appdb{{ loop.index }}DNS": { - "Type": "AWS::Route53::RecordSetGroup", - "Properties": { - "HostedZoneId" : { "Ref" : "zoneinternalidns" }, - - "RecordSets": [ - { - "Name": "appdb{{ loop.index }}.{{ zone_internal_dns }}", - "Type": "A", - "TTL": "10", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "appdb{{ loop.index }}", - "PrivateIp" - ] - } - ] - } - ] - } - }, -{% endfor %} - -{% for c in range(1, (support_instance_count | int) + 1) %} - "support{{ loop.index }}": { - "Type": "AWS::EC2::Instance", - "Properties": { - "ImageId": { - "Fn::FindInMap": [ - "RegionMapping", - { - "Ref": "AWS::Region" - }, - "RHELAMI" - ] - }, - "InstanceType": "{{ support_instance_type }}", - "KeyName": "{{ key_name }}", - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "HostSG", - "GroupId" - ] - } - ], - "SubnetId": { - "Ref": "PublicSubnet" - }, - "Tags": [ - { - "Key": "Name", - "Value": "support{{ loop.index }}" - }, - { - "Key": "AnsibleGroup", - "Value": "support" - }, - { - "Key": "Project", - "Value": "{{ project_tag }}" - }, - { - "Key": "{{ project_tag }}", - "Value": "support" - }, - { - "Key": "internaldns", - "Value": "support{{ loop.index }}.{{ chomped_zone_internal_dns }}" - }, - { - "Key": "owner", - "Value": "{{ email | default('unknown')}}" - } - ], - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "VolumeSize": 50 - } - }, - { - "DeviceName": "/dev/xvdb", - "Ebs": { - "VolumeType": "gp2", - "VolumeSize": 50 - } - } - ] - } - }, - "support{{ loop.index }}DNS": { - "Type": "AWS::Route53::RecordSetGroup", - "Properties": { - "HostedZoneId" : { "Ref" : "zoneinternalidns" }, - "RecordSets": [ - { - "Name": "support{{ loop.index }}.{{ zone_internal_dns }}", - "Type": "A", - "TTL": "10", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "support{{ loop.index }}", - "PrivateIp" - ] - } - ] - } - ] - } - }{% if not loop.last %},{% endif %} -{% endfor %} - }, - "Outputs": { - "Route53internalzoneOutput": { - "Description": "The ID of the internal route 53 zone", - "Value": { - "Ref": "zoneinternalidns" - } - } - } -} diff --git a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/terraform_ec2_cloud_template.tf.j2 b/ansible/configs/vld-pattern-base-binder/files/cloud_providers/terraform_ec2_cloud_template.tf.j2 deleted file mode 100644 index 9d1f4ad472c..00000000000 --- a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/terraform_ec2_cloud_template.tf.j2 +++ /dev/null @@ -1,164 +0,0 @@ -#---------------------------------------------- -# Terraform ec2 variables -#---------------------------------------------- -variable "aws_access_key" {} -variable "aws_secret_key" {} -variable "security_group" { default = "{{ env_type }}-host_sg" } -variable "keypair" { default = "{{ env_type }}-{{ key_name }}" } -variable "aws_region" { default = "us-east-1" } - -variable "aws_amis" { - type = "map" - default = { - RHELAMI.ap-northeast-1 = "ami-5de0433c" - RHELAMI.ap-northeast-2 = "ami-44db152a" - RHELAMI.ap-southeast-1 = "ami-2c95344f" - RHELAMI.ap-southeast-2 = "ami-39ac915a" - RHELAMI.ap-south-1 = "ami-cdbdd7a2" - RHELAMI.eu-central-1 = "ami-e4c63e8b" - RHELAMI.eu-west-1 = "ami-02ace471" - RHELAMI.sa-east-1 = "ami-7de77b11" - RHELAMI.us-east-1 = "ami-b63769a1" - RHELAMI.us-east-2 = "ami-0932686c" - RHELAMI.us-gov-west-1 = "ami-91cfafb2" - RHELAMI.us-west-1 = "ami-2cade64c" - RHELAMI.us-west-2 = "ami-6f68cf0f" - WIN2012R2AMI.us-east-1 = "ami-7da4ab6b" - WIN2012R2AMI.us-east-2 = "ami-ffae8f9a" - WIN2012R2AMI.us-west-1 = "ami-a11836c1" - WIN2012R2AMI.us-west-2 = "ami-a1c1ddd8" - WIN2012R2AMI.eu-west-1 = "ami-cc8e98a8" - WIN2012R2AMI.eu-central-1 = "ami-da1ebdb5" - WIN2012R2AMI.ap-northeast-1 = "ami-4312cc2d" - WIN2012R2AMI.ap-northeast-2 = "ami-68756f0f" - WIN2012R2AMI.ap-southeast-1 = "ami-7644d315" - WIN2012R2AMI.ap-southeast-2 = "ami-468f9225" - WIN2012R2AMI.sa-east-1 = "ami-c8285ca4" - WIN2012R2AMI.ap-south-1 = "ami-8eafd6e1" - } -} - -variable "ebs_root_block_size" { default = "{{ rootfs_size_bastion }}" } - -#---------------------------------------------- -# Access credentials -#---------------------------------------------- -provider "aws" { - access_key = "${var.aws_access_key}" - secret_key = "${var.aws_secret_key}" - region = "${var.aws_region}" -} - -#---------------------------------------------- -# VPC -#---------------------------------------------- -# Main VPC that will contain everything. -resource "aws_vpc" "main" { - cidr_block = "192.168.0.0/16" - enable_dns_support = true - enable_dns_hostnames = true - - tags { - Name = "{{vpcid_name_tag}}" - } -} - -# The public subnet is where resources connected to the internet will go -resource "aws_subnet" "public" { - vpc_id = "${aws_vpc.main.id}" - cidr_block = "192.168.0.0/24" - map_public_ip_on_launch = true - tags { Name = "{{project_tag}}-public-subnet" } -} - -# Internet accessible route table + gateway for the public subnet -resource "aws_internet_gateway" "public" { - vpc_id = "${aws_vpc.main.id}" - tags { Name = "{{vpcid_name_tag}}-igw" } -} - -resource "aws_route_table" "public" { - vpc_id = "${aws_vpc.main.id}" - route { - cidr_block = "0.0.0.0/0" - gateway_id = "${aws_internet_gateway.public.id}" - } - tags { Name = "{{vpcid_name_tag}}-public-rt" } -} - -resource "aws_route_table_association" "public" { - subnet_id = "${aws_subnet.public.id}" - route_table_id = "${aws_route_table.public.id}" -} - -#---------------------------------------------- -# Security Group -#---------------------------------------------- -resource "aws_security_group" "host_sg" { - name = "{{ env_type }}-host_sg" - vpc_id = "${aws_vpc.main.id}" - - ingress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - -} - - -{% for instance in instances %} -variable "{{instance['name']}}_os_version" { default = "{{instance['image_id']}}" } -variable "{{instance['name']}}_instance_type" { default = "{{ instance['name'] + '_instance_type' }}" } # c4.large -variable "{{instance['name']}}_instance_count" { default = "{{ instance['name'] + '_instance_count' }}" } # c4.large - -#---------------------------------------------- -# Instance : {{instance['name']}} -#---------------------------------------------- -resource "aws_instance" "{{instance['name']}}_host" { - count = "{{instance['count']}}" - ami = "${lookup(var.aws_amis, "${var.{{instance['name']}}_os_version}.${var.aws_region}")}" - instance_type = "${var.{{instance['name']}}_instance_type}" - subnet_id = "${aws_subnet.public.id}" - key_name = "${var.keypair}" - security_groups = [ "${aws_security_group.host_sg.id}" ] - - root_block_device = { - volume_type = "gp2" - volume_size = "${var.ebs_root_block_size}" - } - tags { - Name = "{{ env_type }}-{{instance['name']}}-${count.index}" - Role = "{{ env_type }}-{{instance['name']}}" - Workshop = "{{ env_type }}" - sshUser = "ec2-user" - Index = "${count.index}" -{% for tag in instance['tags'] %} - {{tag['key']}} = "{{tag['value']}}" -{% endfor %} - } -} - -#---------------------------------------------- -# DNS -#---------------------------------------------- -resource "aws_route53_record" "{{instance['name']}}_dns" { - # same number of records as instances - count = "{{instance['count']}}" - zone_id = "{{ HostedZoneId }}" - name = "{{instance['name']}}.{{subdomain_base}}." - type = "A" - ttl = "900" - # matches up record N to instance N - records = ["${element(aws_instance.{{instance['name']}}_host.*.public_ip, count.index)}"] -} - -{% endfor %} \ No newline at end of file diff --git a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/terraform_ec2_cloud_template.tfvars.j2 b/ansible/configs/vld-pattern-base-binder/files/cloud_providers/terraform_ec2_cloud_template.tfvars.j2 deleted file mode 100644 index 033aa1a6461..00000000000 --- a/ansible/configs/vld-pattern-base-binder/files/cloud_providers/terraform_ec2_cloud_template.tfvars.j2 +++ /dev/null @@ -1,2 +0,0 @@ -aws_access_key = "{{ aws_access_key_id }}" -aws_secret_key = "{{ aws_secret_access_key }}" \ No newline at end of file diff --git a/ansible/configs/vld-pattern-base-binder/files/repos_template.j2 b/ansible/configs/vld-pattern-base-binder/files/repos_template.j2 deleted file mode 100644 index ca88e64403d..00000000000 --- a/ansible/configs/vld-pattern-base-binder/files/repos_template.j2 +++ /dev/null @@ -1,32 +0,0 @@ -[rhel-7-server-rpms] -name=Red Hat Enterprise Linux 7 -baseurl={{own_repo_path}}/rhel-7-server-rpms -enabled=1 -gpgcheck=0 - -[rhel-7-server-rh-common-rpms] -name=Red Hat Enterprise Linux 7 Common -baseurl={{own_repo_path}}/rhel-7-server-rh-common-rpms -enabled=1 -gpgcheck=0 - -[rhel-7-server-extras-rpms] -name=Red Hat Enterprise Linux 7 Extras -baseurl={{own_repo_path}}/rhel-7-server-extras-rpms -enabled=1 -gpgcheck=0 - -[rhel-7-server-optional-rpms] -name=Red Hat Enterprise Linux 7 Optional -baseurl={{own_repo_path}}/rhel-7-server-optional-rpms -enabled=1 -gpgcheck=0 - -[epel] -name=Extra Packages for Enterprise Linux 7 - $basearch -baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch -mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch -failovermethod=priority -enabled=1 -gpgcheck=0 -#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 diff --git a/ansible/configs/vld-pattern-base-binder/infra.yml b/ansible/configs/vld-pattern-base-binder/infra.yml deleted file mode 100644 index 6783359b235..00000000000 --- a/ansible/configs/vld-pattern-base-binder/infra.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Step 001 infra - hosts: localhost - connection: local - become: false - gather_facts: false - tags: - - step001 - - infrastructure - tasks: - - - name: Entering the vld-pattern-base-binder infra.yml - debug: - msg: - - Entering the vld-pattern-base-binder infra.yml - - - name: Exiting the vld-pattern-base-binder infra.yml - debug: - msg: - - Exiting the vld-pattern-base-binder infra.yml -... diff --git a/ansible/configs/vld-pattern-base-binder/post_infra.yml b/ansible/configs/vld-pattern-base-binder/post_infra.yml deleted file mode 100644 index 54fd36426d0..00000000000 --- a/ansible/configs/vld-pattern-base-binder/post_infra.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Step 002 Post Infrastructure - hosts: localhost - connection: local - become: false - gather_facts: false - tags: - - step002 - - post_infrastructure - tasks: - - - name: Entering the vld-pattern-base-binder post_infra.yml - debug: - msg: - - Entering the vld-pattern-base-binder post_infra.yml - - - name: Exiting the vld-pattern-base-binder post_infra.yml - debug: - msg: - - Exiting the vld-pattern-base-binder post_infra.yml -... diff --git a/ansible/configs/vld-pattern-base-binder/post_software.yml b/ansible/configs/vld-pattern-base-binder/post_software.yml deleted file mode 100644 index 40ca8d2767b..00000000000 --- a/ansible/configs/vld-pattern-base-binder/post_software.yml +++ /dev/null @@ -1,35 +0,0 @@ -# vim: set ft=yaml.ansible ---- -- name: Step 005 Post Software - hosts: localhost - connection: local - become: false - gather_facts: false - tags: - - step005 - - post_software - tasks: - - name: Entering the vld-pattern-base-binder post_software.yml - debug: - msg: - - Entering the vld-pattern-base-binder post_software.yml - -- name: Step 005 Post Software - Report to Cloudforms - hosts: localhost - connection: local - become: false - gather_facts: false - tags: - - step005 - - post_software - tasks: - - - name: Print string expected by Cloudforms - debug: - msg: "Post-Software checks completed successfully" - - - name: Exiting the vld-pattern-base-binder post_software.yml - debug: - msg: - - Exiting the vld-pattern-base-binder post_software.yml -... diff --git a/ansible/configs/vld-pattern-base-binder/pre_infra.yml b/ansible/configs/vld-pattern-base-binder/pre_infra.yml deleted file mode 100644 index fc240d529f0..00000000000 --- a/ansible/configs/vld-pattern-base-binder/pre_infra.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: Step 000 Pre Infrastructure - hosts: localhost - connection: local - become: false - gather_facts: false - - tags: - - step001 - - pre_infrastructure - - tasks: - - - name: Entering the vld-pattern-base-binder pre_infra.yml - debug: - msg: - - Entering the vld-pattern-base-binder pre_infra.yml - - - name: Exiting the vld-pattern-base-binder pre_infra.yml - debug: - msg: - - Exiting the vld-pattern-base-binder pre_infra.yml -... diff --git a/ansible/configs/vld-pattern-base-binder/pre_software.yml b/ansible/configs/vld-pattern-base-binder/pre_software.yml deleted file mode 100644 index 93595c389ba..00000000000 --- a/ansible/configs/vld-pattern-base-binder/pre_software.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: Step 003 Pre Software - hosts: localhost - connection: local - become: false - gather_facts: false - tags: - - step003 - - pre_software - tasks: - - - name: Entering the vld-pattern-base-binder pre_software.yml - debug: - msg: - - Entering the vld-pattern-base-binder pre_software.yml - - - name: Exiting the vld-pattern-base-binder pre_software.yml - debug: - msg: - - Exiting the vld-pattern-base-binder pre_software.yml - - debug: - msg: Pre-Software checks completed successfully -... diff --git a/ansible/configs/vld-pattern-base-binder/requirements.yml b/ansible/configs/vld-pattern-base-binder/requirements.yml deleted file mode 100644 index 29183e11c89..00000000000 --- a/ansible/configs/vld-pattern-base-binder/requirements.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# External role to setup grader host virtualenv and FTL grading infra -#- name: ftl-injector -# src: https://github.com/redhat-gpte-devopsautomation/ftl-injector -# version: v0.17 -collections: -- name: kubernetes.core - version: 2.3.1 -- name: amazon.aws - version: 2.2.0 -- name: community.general - version: 4.6.1 -- name: ansible.posix - version: 1.3.0 -- name: ansible.utils - version: 2.7.0 diff --git a/ansible/configs/vld-pattern-base-binder/sample_vars.yml b/ansible/configs/vld-pattern-base-binder/sample_vars.yml deleted file mode 100644 index 7be20fc55b6..00000000000 --- a/ansible/configs/vld-pattern-base-binder/sample_vars.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -env_type: vld-pattern-base-binder -cloud_provider: none -... diff --git a/ansible/configs/vld-pattern-base-binder/software.yml b/ansible/configs/vld-pattern-base-binder/software.yml deleted file mode 100644 index fcda032c8d8..00000000000 --- a/ansible/configs/vld-pattern-base-binder/software.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Step 004 Software - hosts: localhost - connection: local - become: false - gather_facts: false - tags: - - step004 - - deploy_software - tasks: - - - name: Entering the vld-pattern-base-binder software.yml - debug: - msg: - - Entering the vld-pattern-base-binder software.yml - - - name: Exiting the vld-pattern-base-binder software.yml - debug: - msg: - - Exiting the vld-pattern-base-binder software.yml -... diff --git a/ansible/configs/vld-pattern-base-binder/stop.yml b/ansible/configs/vld-pattern-base-binder/stop.yml deleted file mode 100644 index 95152c356cb..00000000000 --- a/ansible/configs/vld-pattern-base-binder/stop.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Stop vld-pattern-base-binder - hosts: localhost - connection: local - become: false - gather_facts: false - tasks: - - name: Entering the vld-pattern-base-binder stop.yml - debug: - msg: - - Entering the vld-pattern-base-binder stop.yml - - - name: Exiting the vld-pattern-base-binder stop.yml - debug: - msg: - - Exiting the vld-pattern-base-binder stop.yml -... diff --git a/ansible/configs/vld-pattern-base-binder/templates/auto-import-secret.yaml.j2 b/ansible/configs/vld-pattern-base-binder/templates/auto-import-secret.yaml.j2 deleted file mode 100644 index 329aadc6892..00000000000 --- a/ansible/configs/vld-pattern-base-binder/templates/auto-import-secret.yaml.j2 +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Secret -metadata: - name: auto-import-secret - namespace: "{{ __managed_cluster_name }}" -stringData: - autoImportRetry: "5" - # If you are using the kubeconfig file, add the following value for the kubeconfig file - # that has the current context set to the cluster to import: - # kubeconfig: |- - # If you are using the token/server pair, add the following two values instead of - # the kubeconfig file: - token: "{{ __managed_cluster_token }}" - server: "{{ __managed_cluster_api_url }}" -type: Opaque diff --git a/ansible/configs/vld-pattern-base-binder/templates/dev_secured_cluster.yaml.j2 b/ansible/configs/vld-pattern-base-binder/templates/dev_secured_cluster.yaml.j2 deleted file mode 100644 index d66e799bc0a..00000000000 --- a/ansible/configs/vld-pattern-base-binder/templates/dev_secured_cluster.yaml.j2 +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: platform.stackrox.io/v1alpha1 -kind: SecuredCluster -metadata: - namespace: stackrox - name: stackrox-secured-cluster-services -spec: - clusterName: "aws_dev_cluster" - auditLogs: - collection: Auto - admissionControl: - listenOnUpdates: true - bypass: BreakGlassAnnotation - contactImageScanners: DoNotScanInline - listenOnCreates: true - timeoutSeconds: 3 - listenOnEvents: true - perNode: - collector: - collection: KernelModule - imageFlavor: Regular - taintToleration: TolerateTaints - centralEndpoint: "{{ aws_hub_provision_data.acs_route | urlsplit('hostname') }}:443" - \ No newline at end of file diff --git a/ansible/configs/vld-pattern-base-binder/templates/klusterlet-addon-config.yaml.j2 b/ansible/configs/vld-pattern-base-binder/templates/klusterlet-addon-config.yaml.j2 deleted file mode 100644 index 7ac7c5a248d..00000000000 --- a/ansible/configs/vld-pattern-base-binder/templates/klusterlet-addon-config.yaml.j2 +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: agent.open-cluster-management.io/v1 -kind: KlusterletAddonConfig -metadata: - name: "{{ __managed_cluster_name }}" - namespace: "{{ __managed_cluster_name }}" -spec: - applicationManager: - enabled: true - certPolicyController: - enabled: true - iamPolicyController: - enabled: true - policyController: - enabled: true - searchCollector: - enabled: true diff --git a/ansible/configs/vld-pattern-base-binder/templates/managed-cluster.yaml.j2 b/ansible/configs/vld-pattern-base-binder/templates/managed-cluster.yaml.j2 deleted file mode 100644 index 740daef75a6..00000000000 --- a/ansible/configs/vld-pattern-base-binder/templates/managed-cluster.yaml.j2 +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: cluster.open-cluster-management.io/v1 -kind: ManagedCluster -metadata: - name: "{{ __managed_cluster_name }}" - labels: - cloud: auto-detect - vendor: auto-detect -spec: - hubAcceptsClient: true -... diff --git a/ansible/configs/vld-pattern-base-binder/templates/prod_secured_cluster.yaml.j2 b/ansible/configs/vld-pattern-base-binder/templates/prod_secured_cluster.yaml.j2 deleted file mode 100644 index 068cfda042e..00000000000 --- a/ansible/configs/vld-pattern-base-binder/templates/prod_secured_cluster.yaml.j2 +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: platform.stackrox.io/v1alpha1 -kind: SecuredCluster -metadata: - namespace: stackrox - name: stackrox-secured-cluster-services -spec: - clusterName: "aws_prod_cluster" - auditLogs: - collection: Auto - admissionControl: - listenOnUpdates: true - bypass: BreakGlassAnnotation - contactImageScanners: DoNotScanInline - listenOnCreates: true - timeoutSeconds: 3 - listenOnEvents: true - perNode: - collector: - collection: KernelModule - imageFlavor: Regular - taintToleration: TolerateTaints - centralEndpoint: "{{ aws_hub_provision_data.acs_route | urlsplit('hostname') }}:443" - \ No newline at end of file diff --git a/ansible/configs/vld-pattern-base-binder/update.yml b/ansible/configs/vld-pattern-base-binder/update.yml deleted file mode 100644 index 6b216c16eaf..00000000000 --- a/ansible/configs/vld-pattern-base-binder/update.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Update vld-pattern-base-binder - hosts: localhost - connection: local - become: false - gather_facts: false - tasks: - - name: Entering the vld-pattern-base-binder update.yml - debug: - msg: - - Entering the vld-pattern-base-binder update.yml - - - name: Exiting the vld-pattern-base-binder update.yml - debug: - msg: - - Exiting the vld-pattern-base-binder update.yml -...