From 8074e8a458a9e56c2fce448d4a509d09750790a9 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Sun, 4 Sep 2022 14:04:45 -0700 Subject: [PATCH] WIP: CEPH --- nomad/ansible_hosts.yml | 3 +++ nomad/setup-cluster.yml | 6 ++++++ nomad/storage_plugins/ceph.nomad | 9 +++++++++ 3 files changed, 18 insertions(+) create mode 100644 nomad/storage_plugins/ceph.nomad diff --git a/nomad/ansible_hosts.yml b/nomad/ansible_hosts.yml index 129d594..9fe40b3 100644 --- a/nomad/ansible_hosts.yml +++ b/nomad/ansible_hosts.yml @@ -4,6 +4,7 @@ all: servers: hosts: n1.thefij: + cephfs: true # consul_node_role: bootstrap nomad_node_role: both nomad_unique_host_volumes: @@ -20,6 +21,7 @@ all: mode: "0755" read_only: false n2.thefij: + cephfs: true nomad_node_role: both nomad_unique_host_volumes: - name: nextcloud-data @@ -41,6 +43,7 @@ all: mode: "0755" read_only: false n3.thefij: + cephfs: true nomad_node_class: ingress nomad_node_role: both pi4: diff --git a/nomad/setup-cluster.yml b/nomad/setup-cluster.yml index b620b4f..7a7ec8e 100644 --- a/nomad/setup-cluster.yml +++ b/nomad/setup-cluster.yml @@ -243,6 +243,12 @@ state: mounted fstype: nfs4 + - name: Enable cephfs support + modprobe: + name: rbd + state: present + when: cephfs + - name: Install Docker hosts: nomad_instances become: true diff --git a/nomad/storage_plugins/ceph.nomad b/nomad/storage_plugins/ceph.nomad new file mode 100644 index 0000000..d4a215b --- /dev/null +++ b/nomad/storage_plugins/ceph.nomad @@ -0,0 +1,9 @@ +job { + + # Don't run on Raspberry Pi because kernel mod is not present + constraint { + attribute = "${attr.kernel.version}" + operator = "regexp" + value = "(?!-raspi)" + } +}