- name: Install Unzip apt: name: unzip state: present - name: Checking if Nomad Binary Exists stat: path: /usr/bin/nomad register: nomad_file - name: Download and Extract Nomad binary and move to /usr/bin unarchive: src: https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_amd64.zip dest: /usr/bin remote_src: yes when: nomad_file.stat.exists == False - name: Create Nomad Configuration Directory file: path: /etc/nomad state: directory - name: Render Nomad Configuration Template to /usr/nomad/config.hcl template: src: config.hcl.j2 dest: /etc/nomad/config.hcl - name: Copying Nomad Init File copy: src: nomad.service dest: /etc/systemd/system/nomad.service - name: Enabling Nomad Systemd Service systemd: name: nomad.service enabled: yes