Skip to content

Commit

Permalink
AWS deploy: add big (hence fast) EBS volume to QED servers
Browse files Browse the repository at this point in the history
  • Loading branch information
panchoh committed Feb 28, 2019
1 parent 79f1d25 commit 8ab7fbb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deploy/aws/modules/qed/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ resource "aws_instance" "qed-server" {
volume_size = "${var.volume_size}"
}]

ebs_block_device = {
device_name = "/dev/xvdc"
volume_type = "gp2"
volume_size = "${var.ebs_volume_size}"
delete_on_termination = "true"
}

tags {
Name = "${format("${var.name}-%01d", count.index)}"
Role = "${var.role}"
Expand Down
4 changes: 4 additions & 0 deletions deploy/aws/modules/qed/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ variable "iam_instance_profile" {}

variable "volume_size" {}

variable "ebs_volume_size" {
default = 1000
}

variable "vpc_security_group_ids" {}

variable "subnet_id" {}
Expand Down
23 changes: 23 additions & 0 deletions deploy/aws/provision/tasks/common/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,29 @@
with_items:
- qed

- name: Register stat on EBS device
stat:
path: /dev/xvdc
get_attributes: no
get_checksum: no
register: ebs_device

- name: Create xfs filesystem on EBS volume
filesystem:
force: yes
fstype: xfs
dev: "{{ ebs_device.stat.path }}"
when: ebs_device.stat.exists

- name: Mount xfs filesystem on /var/qed
mount:
path: /var/qed
src: "{{ ebs_device.stat.path }}"
fstype: xfs
state: mounted
opts: noatime
when: ebs_device.stat.exists

- name: Install additional packages
yum:
name: "{{ packages }}"
Expand Down

0 comments on commit 8ab7fbb

Please sign in to comment.