aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/nomad/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/nomad/tasks/main.yml')
-rw-r--r--ansible/roles/nomad/tasks/main.yml19
1 files changed, 18 insertions, 1 deletions
diff --git a/ansible/roles/nomad/tasks/main.yml b/ansible/roles/nomad/tasks/main.yml
index 7c73362..3bfd3a6 100644
--- a/ansible/roles/nomad/tasks/main.yml
+++ b/ansible/roles/nomad/tasks/main.yml
@@ -1,7 +1,11 @@
-- name: "Set nomad version"
+- name: "Set Nomad version"
set_fact:
nomad_version: 0.12.0-beta2
+- name: "Set CNI version"
+ set_fact:
+ cni_plugins_version: 0.8.6
+
- name: "Download and install Nomad for x86_64"
unarchive:
src: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_amd64.zip"
@@ -10,6 +14,19 @@
when:
- "ansible_architecture == 'x86_64'"
+- name: "Create /opt/cni/bin"
+ file: path=/opt/cni/bin state=directory
+
+- name: "Download and install CNI plugins for x86_64"
+ unarchive:
+ src: "https://github.com/containernetworking/plugins/releases/download/v{{ cni_plugins_version }}/cni-plugins-linux-amd64-v{{ cni_plugins_version }}.tgz"
+ dest: /opt/cni/bin
+ remote_src: yes
+ when:
+ - "ansible_architecture == 'x86_64'"
+ notify:
+ - restart nomad
+
- name: "Create Nomad configuration directory"
file: path=/etc/nomad/ state=directory