Skip to content

Commit

Permalink
Merge pull request #2 from SeqWare/feature/lvm
Browse files Browse the repository at this point in the history
Feature/lvm
  • Loading branch information
denis-yuen committed Nov 14, 2014
2 parents b22a706 + d6815d3 commit 5ec1240
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This project consists of a set of Ansible playbooks that allow you to deploy a SeqWare cluster. Metadata makes the Playbooks compatible with [CloudBindle](https://github.com/CloudBindle/Bindle) allowing you to deploy to Amazon-AWS, VirtualBox, Openstack, and vCloud.

## Dependencies

Unfortunately, while tested against ansible 1.6.10, lvm functionality requires a patch from ansible develop that can be applied on ubuntu as follows.

wget https://raw.githubusercontent.com/ansible/ansible-modules-extras/devel/system/lvg.py
sudo cp lvg.py /usr/share/ansible/system/lvg

## Sample Configuration Files

### Updated for Bindle 2
Expand Down
8 changes: 4 additions & 4 deletions roles/storage/common/tasks/play_deploy_shared_storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
sudo: True
tasks:
- { include_vars: "../../vars/main.yml" }
- { include: "../../{{shared_storage_system}}/tasks/install.yml", when: not single_node }
- { include: "../../{{shared_storage_system}}/tasks/install.yml", when: not single_node}

### Storage - second step, configure and start the master
- hosts: master
sudo: True
tasks:
- { include_vars: "../../vars/main.yml" }
- { include: "../../{{shared_storage_system}}/tasks/start.yml", when: not single_node }
- { include: "../../{{shared_storage_system}}/tasks/start.yml", when: not single_node}

### Storage - third step, configure and start the data servers
- hosts: worker
sudo: True
tasks:
- { include_vars: "../../vars/main.yml" }
- { include: "../../{{shared_storage_system}}/tasks/connect.yml", when: not single_node }
- { include: "../../{{shared_storage_system}}/tasks/connect.yml", when: not single_node}

### Storage - fourth step, mount directories where needed
- hosts: all
sudo: True
tasks:
- { include_vars: "../../vars/main.yml" }
- { include: "../../{{shared_storage_system}}/tasks/mount.yml", when: not single_node }
- { include: "../../{{shared_storage_system}}/tasks/mount.yml", when: not single_node}
4 changes: 4 additions & 0 deletions roles/storage/lvm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
LVM
-----

Not technically a shared filesystem, but might be useful to have in seqware-bag
1 change: 1 addition & 0 deletions roles/storage/lvm/tasks/connect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
20 changes: 20 additions & 0 deletions roles/storage/lvm/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# file: roles/storage/lvm/tasks/install.yml
# These tasks are run on all nodes

- name: Ensure required packages are installed
apt: pkg={{ item }} state=latest cache_valid_time=86400 update_cache=yes
with_items:
- lvm2
- parted
- xfsprogs

- name: Storage | Create a volume group white listed devices
lvg: vg=volume_group pvs={{ lvm_device_whitelist }} state=present vg_options=

- name: Storage | Create logical volume
lvol: vg=volume_group lv=logical_volume state=present size=100%FREE

- name: Storage | Create file system
filesystem: dev=/dev/volume_group/logical_volume fstype={{ brick_file_system }}

5 changes: 5 additions & 0 deletions roles/storage/lvm/tasks/mount.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# file: roles/storage/lvm/tasks/mount.yml

- name: Storage | Mount lvm volume
mount: name={{ vendor_data }} src=/dev/volume_group/logical_volume fstype={{ brick_file_system }} opts=rw,noauto state=mounted
4 changes: 4 additions & 0 deletions roles/storage/lvm/tasks/start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
# file: roles/lvm/tasks/glusterfs_start.yml


2 changes: 2 additions & 0 deletions roles/storage/lvm/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
lvm_device_whitelist: '/dev/xvdd,/dev/xvde'
15 changes: 14 additions & 1 deletion seqware-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,27 @@
template: src=roles/common/templates/dhclient.conf dest=/etc/dhcp/dhclient.conf
- name: Disable setting hostname from /etc/hostname on Amazon EC2
template: src=roles/common/templates/hostname.conf dest=/etc/init/hostname.conf
- name: Disable ephemeral mount at /mnt for amazon AWS
shell: umount /mnt
register: umount_output
ignore_errors: yes

# This is a super-fugly way of determining the number of hosts in total, Ansible bug referenced
- hosts: all
sudo: True
tasks:
- name: Determine number of hosts in fugly way
include: roles/common/tasks/determine_num_hosts.yml


- hosts: all
sudo: True
vars:
shared_storage_system: lvm
vendor_data: /mnt/seqware-oozie
lvm_device_whitelist: /dev/xvdd,/dev/xvde
include: roles/storage/common/tasks/play_deploy_shared_storage.yml
when: single_node_lvm is defined

- hosts: all
sudo: True
vars:
Expand Down

0 comments on commit 5ec1240

Please sign in to comment.