This playbook installs Nomad and enables the service.
- name: Install Nomad
hosts: nomad
become: true
tasks:
- name: Install Nomad on Debian family
ansible.builtin.apt:
update_cache: true
name: nomad
state: present
when: ansible_os_family == "Debian"
- name: Install Nomad on RHEL family
ansible.builtin.dnf:
name: nomad
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start Nomad
ansible.builtin.systemd:
name: nomad
enabled: true
state: started
- name: Verify Nomad version
ansible.builtin.command: nomad version
changed_when: false