From 311a592d6e2277343f41f99cb7c5f2a24bca0043 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 20 May 2025 15:06:04 -0700 Subject: [PATCH] Adding a task subset for host volume setup --- ansible/nuc.yaml | 1 + ansible/roles/local-server-head/tasks/main.yaml | 10 +++++++++- .../local-server-head/tasks/nomad-host-volumes.yaml | 8 ++++++++ ansible/roles/local-server-head/vars/main.yaml | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/local-server-head/tasks/nomad-host-volumes.yaml diff --git a/ansible/nuc.yaml b/ansible/nuc.yaml index 12eb585..81f1f7d 100644 --- a/ansible/nuc.yaml +++ b/ansible/nuc.yaml @@ -7,5 +7,6 @@ - setup - nomad - proxy + - volumes ansible.builtin.include_role: name: local-server-head diff --git a/ansible/roles/local-server-head/tasks/main.yaml b/ansible/roles/local-server-head/tasks/main.yaml index d2898f0..373f75d 100644 --- a/ansible/roles/local-server-head/tasks/main.yaml +++ b/ansible/roles/local-server-head/tasks/main.yaml @@ -30,4 +30,12 @@ apply: become: true tags: - - proxy \ No newline at end of file + - proxy +- name: Setup data directory for the nomad host volumes + tags: volumes + ansible.builtin.include_tasks: + file: nomad-host-volumes.yaml + apply: + become: true + tags: + - volumes \ No newline at end of file diff --git a/ansible/roles/local-server-head/tasks/nomad-host-volumes.yaml b/ansible/roles/local-server-head/tasks/nomad-host-volumes.yaml new file mode 100644 index 0000000..b6932c0 --- /dev/null +++ b/ansible/roles/local-server-head/tasks/nomad-host-volumes.yaml @@ -0,0 +1,8 @@ +- name: Ensure the root data directory is present + ansible.builtin.file: + path: "{{ host_vol_root }}" + state: directory +- name: Ensure registry volume is present + ansible.builtin.file: + path: "{{ host_vol_root }}/ncr" + state: directory \ No newline at end of file diff --git a/ansible/roles/local-server-head/vars/main.yaml b/ansible/roles/local-server-head/vars/main.yaml index e69de29..43dce24 100644 --- a/ansible/roles/local-server-head/vars/main.yaml +++ b/ansible/roles/local-server-head/vars/main.yaml @@ -0,0 +1 @@ +host_vol_root: /opt/volumes \ No newline at end of file