You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by ce...@apache.org on 2016/03/14 14:04:05 UTC

incubator-metron git commit: METRON-63 Support Provisioning Multiple, Isolated Clusters with Amazon EC2 (nickwallen via cestella) closes apache/incubator-metron#42

Repository: incubator-metron
Updated Branches:
  refs/heads/master 8cfd3d529 -> 2da0367c0


METRON-63 Support Provisioning Multiple, Isolated Clusters with Amazon EC2 (nickwallen via cestella) closes apache/incubator-metron#42


Project: http://git-wip-us.apache.org/repos/asf/incubator-metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-metron/commit/2da0367c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-metron/tree/2da0367c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-metron/diff/2da0367c

Branch: refs/heads/master
Commit: 2da0367c0a94143ac5dc0598b824a59430508cd6
Parents: 8cfd3d5
Author: nickwallen <ni...@nickallen.org>
Authored: Mon Mar 14 09:04:05 2016 -0400
Committer: cstella <ce...@gmail.com>
Committed: Mon Mar 14 09:04:05 2016 -0400

----------------------------------------------------------------------
 deployment/amazon-ec2/README.md                           |  9 +++++++++
 deployment/amazon-ec2/conf/defaults.yml                   |  2 +-
 deployment/amazon-ec2/tasks/create-hosts.yml              |  7 ++++---
 deployment/amazon-ec2/tasks/create-keypair.yml            | 10 ++++++++--
 .../tasks/create-open-inbound-security-group.yml          |  4 ++--
 .../tasks/create-open-outbound-security-group.yml         |  4 ++--
 deployment/amazon-ec2/tasks/create-security-group.yml     |  6 +++---
 deployment/amazon-ec2/tasks/create-vpc.yml                | 10 +++++++---
 8 files changed, 36 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/README.md
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/README.md b/deployment/amazon-ec2/README.md
index bd0a50b..63f0c89 100644
--- a/deployment/amazon-ec2/README.md
+++ b/deployment/amazon-ec2/README.md
@@ -42,3 +42,12 @@ Each of the provisioned hosts will be externally accessible from the internet at
 ```
 ssh centos@ec2-52-91-215-174.compute-1.amazonaws.com
 ```
+
+Multiple Environments
+---------------------
+
+This process can support provisioning of multiple, isolated environments.  Simply change the `env` settings in `conf/defaults.yml`.  For example, you might provision separate development, test, and production environments.
+
+```
+env: metron-test
+```

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/conf/defaults.yml
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/conf/defaults.yml b/deployment/amazon-ec2/conf/defaults.yml
index 0c260b9..e3261b3 100644
--- a/deployment/amazon-ec2/conf/defaults.yml
+++ b/deployment/amazon-ec2/conf/defaults.yml
@@ -20,7 +20,7 @@ region: us-west-2
 instance_type: m4.xlarge
 image: ami-05cf2265
 volume_type: standard
-key_name: metron-test
+key_name: metron-key
 env: metron-test
 
 # ambari

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/tasks/create-hosts.yml
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/tasks/create-hosts.yml b/deployment/amazon-ec2/tasks/create-hosts.yml
index f162d7f..7ebb6d5 100644
--- a/deployment/amazon-ec2/tasks/create-hosts.yml
+++ b/deployment/amazon-ec2/tasks/create-hosts.yml
@@ -15,14 +15,14 @@
 #  limitations under the License.
 #
 ---
-- name: Instantiate '{{ host_count }}' host(s) as '{{ host_type }}'
+- name: "{{ env }}: Instantiate {{ host_count }} host(s) as {{ host_type }}"
   ec2:
     region: "{{ region }}"
     instance_type: "{{ instance_type }}"
     image: "{{ image }}"
-    key_name: "{{ key_name }}"
+    key_name: "{{ env }}-{{ key_name }}"
     assign_public_ip: True
-    group: [vpc-all-inbound,vpc-all-outbound]
+    group: ["{{ env }}-vpc-all-inbound","{{ env }}-vpc-all-outbound"]
     vpc_subnet_id: "{{ vpc.subnets[0].id }}"
     instance_tags:
       Name: "[{{ env }}] {{ host_type }}"
@@ -31,6 +31,7 @@
     exact_count: "{{ host_count }}"
     count_tag:
       type: "{{ host_type }}"
+      env: "{{ env }}"
     volumes:
     - device_name: /dev/sda1
       volume_type: "{{ volume_type }}"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/tasks/create-keypair.yml
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/tasks/create-keypair.yml b/deployment/amazon-ec2/tasks/create-keypair.yml
index b26a6e4..693039e 100644
--- a/deployment/amazon-ec2/tasks/create-keypair.yml
+++ b/deployment/amazon-ec2/tasks/create-keypair.yml
@@ -15,9 +15,15 @@
 #  limitations under the License.
 #
 ---
+- set_fact:
+    the_key_file: "{{ key_file | default('~/.ssh/id_rsa.pub') }}"
+
 - name: Define keypair
   ec2_key:
-    name: "{{ key_name }}"
+    name: "{{ env }}-{{ key_name }}"
     region: "{{ region }}"
     key_material: "{{ item }}"
-  with_file: "{{ key_file | default('~/.ssh/id_rsa.pub') }}"
+  with_file: "{{ the_key_file }}"
+
+- debug: msg="Created keypair '{{ env }}-{{ key_name }}' from '{{ the_key_file }}'"
+

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/tasks/create-open-inbound-security-group.yml
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/tasks/create-open-inbound-security-group.yml b/deployment/amazon-ec2/tasks/create-open-inbound-security-group.yml
index 9c6e5da..67e89c8 100644
--- a/deployment/amazon-ec2/tasks/create-open-inbound-security-group.yml
+++ b/deployment/amazon-ec2/tasks/create-open-inbound-security-group.yml
@@ -15,9 +15,9 @@
 #  limitations under the License.
 #
 ---
-- name: WARNING Define open inbound security group
+- name: "{{ env }}: Define open inbound security group"
   ec2_group:
-    name: vpc-all-inbound
+    name: "{{ env }}-vpc-all-inbound"
     description: WARNING allow all inbound connections from the internet
     region: "{{ region }}"
     vpc_id: "{{ vpc_id }}"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/tasks/create-open-outbound-security-group.yml
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/tasks/create-open-outbound-security-group.yml b/deployment/amazon-ec2/tasks/create-open-outbound-security-group.yml
index 3d53026..53f505f 100644
--- a/deployment/amazon-ec2/tasks/create-open-outbound-security-group.yml
+++ b/deployment/amazon-ec2/tasks/create-open-outbound-security-group.yml
@@ -15,9 +15,9 @@
 #  limitations under the License.
 #
 ---
-- name: Define outbound security group
+- name: "{{ env }}: Define open outbound security group"
   ec2_group:
-    name: vpc-all-outbound
+    name: "{{ env }}-vpc-all-outbound"
     description: allow all outbound connections to the internet
     region: "{{ region }}"
     vpc_id: "{{ vpc_id }}"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/tasks/create-security-group.yml
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/tasks/create-security-group.yml b/deployment/amazon-ec2/tasks/create-security-group.yml
index c52271d..1c9b909 100644
--- a/deployment/amazon-ec2/tasks/create-security-group.yml
+++ b/deployment/amazon-ec2/tasks/create-security-group.yml
@@ -15,11 +15,11 @@
 #  limitations under the License.
 #
 ---
-- name: Define "{{ name }}" security group
+- name: "{{ env }}: Define the {{ name }} security group"
   ec2_group:
-    name: "{{ name }}"
+    name: "{{ env }}-{{ name }}"
     region: "{{ region }}"
-    description: "{{ name }} - {{ proto }} - {{ port }}"
+    description: "[{{env}}] {{ name }}/{{ proto }}/{{ port }}"
     vpc_id: "{{ vpc_id }}"
     rules:
       - proto: "{{ proto }}"

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/2da0367c/deployment/amazon-ec2/tasks/create-vpc.yml
----------------------------------------------------------------------
diff --git a/deployment/amazon-ec2/tasks/create-vpc.yml b/deployment/amazon-ec2/tasks/create-vpc.yml
index 7af14a1..12d16dc 100644
--- a/deployment/amazon-ec2/tasks/create-vpc.yml
+++ b/deployment/amazon-ec2/tasks/create-vpc.yml
@@ -15,12 +15,16 @@
 #  limitations under the License.
 #
 ---
-  - name: Create vpc
+  - name: "{{ env }}:  Create virtual private cloud"
     ec2_vpc:
       region: "{{ region }}"
       internet_gateway: True
-      resource_tags: { Name: Metron }
+      resource_tags:
+        Name: "{{ env }}-virtual-private-cloud"
+        env: "{{ env }}"
       cidr_block: 10.0.0.0/16
+      dns_hostnames: yes
+      dns_support: yes
       subnets:
         - cidr: 10.0.0.0/24
           resource_tags:
@@ -41,6 +45,6 @@
             gw: igw
     register: vpc
 
-  - name: Created vpc with id='"{{ vpc.vpc_id }}"'
+  - name: "[{{ env }}] Created vpc with id='{{ vpc.vpc_id }}'"
     set_fact:
       vpc_id: "{{ vpc.vpc_id }}"