diff options
author | Chengcheng Mu <bob3841b@gmail.com> | 2015-11-19 08:08:07 +0100 |
---|---|---|
committer | Chengcheng Mu <bob3841b@gmail.com> | 2015-11-19 08:08:07 +0100 |
commit | 0925d936bf1d5b22951b644d9430f443f0551cac (patch) | |
tree | c4dbe821b26bcabbcec5bab07530cdb9f42ebf71 | |
parent | 31dbbf54a22202dfcce44dbb82f8bfcb4ea5181c (diff) | |
parent | f9d918450b27b8f7429f050ed5f781492406b385 (diff) | |
download | openshift-0925d936bf1d5b22951b644d9430f443f0551cac.tar.gz openshift-0925d936bf1d5b22951b644d9430f443f0551cac.tar.bz2 openshift-0925d936bf1d5b22951b644d9430f443f0551cac.tar.xz openshift-0925d936bf1d5b22951b644d9430f443f0551cac.zip |
Merge pull request #1 from detiber/dockerOnMasterAWS
small tweaks for adding docker volume for aws master hosts
-rw-r--r-- | filter_plugins/oo_filters.py | 4 | ||||
-rw-r--r-- | playbooks/aws/openshift-cluster/tasks/launch_instances.yml | 3 | ||||
-rw-r--r-- | playbooks/aws/openshift-cluster/templates/user_data.j2 | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 4dfa33a2c..e50cca6a7 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -220,7 +220,7 @@ class FilterModule(object): root_vol['delete_on_termination'] = True if root_vol['device_type'] != 'io1': root_vol.pop('iops', None) - if host_type in ['master', 'node']: + if host_type in ['master', 'node'] and 'docker' in data[host_type]: docker_vol = data[host_type]['docker'] docker_vol['device_name'] = '/dev/xvdb' docker_vol['delete_on_termination'] = True @@ -231,7 +231,7 @@ class FilterModule(object): docker_vol.pop('delete_on_termination', None) docker_vol['ephemeral'] = 'ephemeral0' return [root_vol, docker_vol] - elif host_type == 'etcd': + elif host_type == 'etcd' and 'etcd' in data[host_type]: etcd_vol = data[host_type]['etcd'] etcd_vol['device_name'] = '/dev/xvdb' etcd_vol['delete_on_termination'] = True diff --git a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml index f392fdbc3..b109c165c 100644 --- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml @@ -81,7 +81,6 @@ - set_fact: latest_ami: "{{ ami_result.results | oo_ami_selector(ec2_image_name) }}" - user_data: "{{ lookup('template', '../templates/user_data.j2') }}" volume_defs: etcd: root: @@ -125,7 +124,7 @@ count: "{{ instances | length }}" vpc_subnet_id: "{{ ec2_vpc_subnet | default(omit, true) }}" assign_public_ip: "{{ ec2_assign_public_ip | default(omit, true) }}" - user_data: "{{ user_data }}" + user_data: "{{ lookup('template', '../templates/user_data.j2') }}" wait: yes instance_tags: created-by: "{{ created_by }}" diff --git a/playbooks/aws/openshift-cluster/templates/user_data.j2 b/playbooks/aws/openshift-cluster/templates/user_data.j2 index b7d89eac1..22ab84977 100644 --- a/playbooks/aws/openshift-cluster/templates/user_data.j2 +++ b/playbooks/aws/openshift-cluster/templates/user_data.j2 @@ -1,5 +1,5 @@ #cloud-config -{% if type =='etcd' %} +{% if type == 'etcd' and 'etcd' in volume_defs[type] %} cloud_config_modules: - disk_setup - mounts @@ -19,7 +19,7 @@ fs_setup: partition: auto {% endif %} -{% if type == 'node' or type == 'master' %} +{% if type in ['node', 'master'] and 'docker' in volume_defs[type] %} mounts: - [ xvdb ] - [ ephemeral0 ] |