summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-11-18 15:44:18 -0500
committerThomas Wiest <twiest@users.noreply.github.com>2015-11-18 15:44:18 -0500
commitfd3b05dd27d7be331bff92024771f333174a1a74 (patch)
tree0bd0179900bd79cfc8953b767e70a240d703f8d1
parent07b8c1d6233574100a067f9765741da7a62e2d7a (diff)
parent4893e96fcb4fb27c7337f9f962e375aef2040233 (diff)
downloadopenshift-fd3b05dd27d7be331bff92024771f333174a1a74.tar.gz
openshift-fd3b05dd27d7be331bff92024771f333174a1a74.tar.bz2
openshift-fd3b05dd27d7be331bff92024771f333174a1a74.tar.xz
openshift-fd3b05dd27d7be331bff92024771f333174a1a74.zip
Merge pull request #918 from detiber/fix_ec2_instance_type_override
Fix ec2 instance type override
-rw-r--r--README_AWS.md13
-rw-r--r--playbooks/aws/openshift-cluster/tasks/launch_instances.yml12
2 files changed, 16 insertions, 9 deletions
diff --git a/README_AWS.md b/README_AWS.md
index d9e2ac5a9..16ccb07e8 100644
--- a/README_AWS.md
+++ b/README_AWS.md
@@ -81,9 +81,20 @@ Node specific defaults:
- Docker volume type: gp2 (only applicable if ephemeral is false)
- Docker volume iops: 500 (only applicable when volume type is io1)
+Specifying ec2 instance type.
+All instances:
+- export ec2_instance_type='m4.large'
+Master instances:
+- export ec2_master_instance_type='m4.large'
+Infra node instances:
+- export ec2_infra_instance_type='m4.large'
+Non-infra node instances:
+- export ec2_node_instance_type='m4.large'
+etcd instances:
+- export ec2_etcd_instance_type='m4.large'
+
If needed, these values can be changed by setting environment variables on your system.
-- export ec2_instance_type='m4.large'
- export ec2_image='ami-307b3658'
- export ec2_region='us-east-1'
- export ec2_keypair='libra'
diff --git a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
index 9c699120b..c40d5673f 100644
--- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
@@ -20,10 +20,6 @@
| default(deployment_vars[deployment_type].image, true) }}"
when: ec2_image is not defined and not ec2_image_name
- set_fact:
- ec2_instance_type: "{{ lookup('env', 'ec2_instance_type')
- | default(deployment_vars[deployment_type].type, true) }}"
- when: ec2_instance_type is not defined
-- set_fact:
ec2_keypair: "{{ lookup('env', 'ec2_keypair')
| default(deployment_vars[deployment_type].keypair, true) }}"
when: ec2_keypair is not defined
@@ -37,25 +33,25 @@
when: ec2_assign_public_ip is not defined
- set_fact:
- ec2_instance_type: "{{ ec2_master_instance_type | default(deployment_vars[deployment_type].type, true) }}"
+ ec2_instance_type: "{{ ec2_master_instance_type | default(lookup('env', 'ec2_master_instance_type') | default(lookup('env', 'ec2_instance_type') | default(deployment_vars[deployment_type].type))) }}"
ec2_security_groups: "{{ ec2_master_security_groups
| default(deployment_vars[deployment_type].security_groups, true) }}"
when: host_type == "master" and sub_host_type == "default"
- set_fact:
- ec2_instance_type: "{{ ec2_etcd_instance_type | default(deployment_vars[deployment_type].type, true) }}"
+ ec2_instance_type: "{{ ec2_etcd_instance_type | default(lookup('env', 'ec2_etcd_instance_type') | default(lookup('env', 'ec2_instance_type') | default(deployment_vars[deployment_type].type))) }}"
ec2_security_groups: "{{ ec2_etcd_security_groups
| default(deployment_vars[deployment_type].security_groups, true)}}"
when: host_type == "etcd" and sub_host_type == "default"
- set_fact:
- ec2_instance_type: "{{ ec2_infra_instance_type | default(deployment_vars[deployment_type].type, true) }}"
+ ec2_instance_type: "{{ ec2_infra_instance_type | default(lookup('env', 'ec2_infra_instance_type') | default(lookup('env', 'ec2_instance_type') | default(deployment_vars[deployment_type].type))) }}"
ec2_security_groups: "{{ ec2_infra_security_groups
| default(deployment_vars[deployment_type].security_groups, true) }}"
when: host_type == "node" and sub_host_type == "infra"
- set_fact:
- ec2_instance_type: "{{ ec2_node_instance_type | default(deployment_vars[deployment_type].type, true) }}"
+ ec2_instance_type: "{{ ec2_node_instance_type | default(lookup('env', 'ec2_node_instance_type') | default(lookup('env', 'ec2_instance_type') | default(deployment_vars[deployment_type].type))) }}"
ec2_security_groups: "{{ ec2_node_security_groups
| default(deployment_vars[deployment_type].security_groups, true) }}"
when: host_type == "node" and sub_host_type == "compute"