summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2015-07-10 16:44:11 -0400
committerJason DeTiberus <jdetiber@redhat.com>2015-07-10 16:44:11 -0400
commitaefff9001ab43155696820f01db7cc11de5cfcea (patch)
treed3cee420bafce1fffb340eb59fe07096aa15f93c
parentf752eaccbb1a5f0e2c1d36502f755d022a21d073 (diff)
downloadopenshift-aefff9001ab43155696820f01db7cc11de5cfcea.tar.gz
openshift-aefff9001ab43155696820f01db7cc11de5cfcea.tar.bz2
openshift-aefff9001ab43155696820f01db7cc11de5cfcea.tar.xz
openshift-aefff9001ab43155696820f01db7cc11de5cfcea.zip
Add support for separate etcd volume with aws provider through bin/cluster
-rw-r--r--filter_plugins/oo_filters.py7
-rw-r--r--playbooks/aws/openshift-cluster/templates/user_data.j220
-rw-r--r--playbooks/aws/openshift-cluster/terminate.yml2
3 files changed, 28 insertions, 1 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index 30b8819b8..e8f60ca73 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -195,6 +195,13 @@ class FilterModule(object):
docker_vol.pop('delete_on_termination', None)
docker_vol['ephemeral'] = 'ephemeral0'
return [root_vol, docker_vol]
+ elif host_type == 'etcd':
+ etcd_vol = data[host_type]['etcd']
+ etcd_vol['device_name'] = '/dev/xvdb'
+ etcd_vol['delete_on_termination'] = True
+ if etcd_vol['device_type'] != 'io1':
+ etcd_vol.pop('iops', None)
+ return [root_vol, etcd_vol]
return [root_vol]
@staticmethod
diff --git a/playbooks/aws/openshift-cluster/templates/user_data.j2 b/playbooks/aws/openshift-cluster/templates/user_data.j2
index db14bacd1..82c2f4d57 100644
--- a/playbooks/aws/openshift-cluster/templates/user_data.j2
+++ b/playbooks/aws/openshift-cluster/templates/user_data.j2
@@ -1,4 +1,24 @@
#cloud-config
+{% if type =='etcd' %}
+cloud_config_modules:
+- disk_setup
+- mounts
+
+mounts:
+- [ xvdb, /var/lib/etcd, xfs, "defaults" ]
+
+disk_setup:
+ xvdb:
+ table_type: mbr
+ layout: True
+
+fs_setup:
+- label: etcd_storage
+ filesystem: xfs
+ device: /dev/xvdb
+ partition: auto
+{% endif %}
+
{% if type == 'node' %}
mounts:
- [ xvdb ]
diff --git a/playbooks/aws/openshift-cluster/terminate.yml b/playbooks/aws/openshift-cluster/terminate.yml
index 361ab2d37..9c3703aba 100644
--- a/playbooks/aws/openshift-cluster/terminate.yml
+++ b/playbooks/aws/openshift-cluster/terminate.yml
@@ -43,7 +43,7 @@
# Fail if any of the instances failed to terminate with an error other
# than 403 Forbidden
- - fail: msg=Terminating instance {{ item.item.ec2_id }} failed with message {{ item.msg }}
+ - fail: msg=Terminating instance {{ item.ec2_id }} failed with message {{ item.msg }}
when: "'oo_hosts_to_terminate' in groups and item.failed and not item.msg | search(\"error: EC2ResponseError: 403 Forbidden\")"
with_items: ec2_term.results