Skip to content

Commit

Permalink
fix: updated nomad hcl to support volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed Dec 18, 2024
1 parent 6bd5026 commit f313c19
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions infrastructure/nomad/playbooks/templates/jobs/redis.nomad.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#jinja2: trim_blocks:True, lstrip_blocks:True
job "redis-{{ env }}" {
datacenters = ["{{ datacenter }}"]

group "redis-group" {
count = 1

Expand Down Expand Up @@ -47,7 +47,7 @@ job "redis-{{ env }}" {

task "redis-master" {
driver = "exec"
# Download Redis source from the official releases

artifact {
source = "http://download.redis.io/releases/redis-7.4.1.tar.gz"
}
Expand All @@ -74,7 +74,6 @@ job "redis-{{ env }}" {
destination = "local/redis-master.conf"
}

# Build script to compile Redis and run it
template {
data = <<-EOF
#!/usr/bin/env bash
Expand Down
10 changes: 10 additions & 0 deletions infrastructure/nomad/playbooks/templates/services/nomad.hcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ client {
path = "{{ ansible_user_home }}/{{ env }}/artifacts"
}
{% endif %}

host_volume "redis-master-data" {
path = "/opt/redis/master/data"
read_only = false
}

host_volume "redis-replica-data" {
path = "/opt/redis/replica/data"
read_only = false
}
}
{% endif %}

Expand Down

0 comments on commit f313c19

Please sign in to comment.