--- - name: Nomad installed community.general.pkgng: name: "nomad" state: latest tags: - dc1 - dc2 - name: Nomad enabled shell: sysrc nomad_enable="YES" tags: - dc1 - dc2 notify: Nomad restarted - name: Nomad debug set shell: sysrc nomad_debug="YES" tags: - dc1 - dc2 notify: Nomad restarted - name: Nomad dc1 configured shell: sysrc nomad_args="-config /usr/local/etc/nomad -network-interface epair0b -dc dc1" tags: - dc1 notify: Nomad restarted - name: Nomad dc2 configured shell: sysrc nomad_args="-config /usr/local/etc/nomad -network-interface epair0b -dc dc2" tags: - dc2 notify: Nomad restarted - name: Nomad server.hcl installed copy: src: server.hcl dest: /usr/local/etc/nomad/server.hcl owner: root mode: 0644 tags: - dc1 - dc2 notify: Nomad restarted - name: Nomad client1.hcl removed file: state: absent dest: /usr/local/etc/nomad/client1.hcl tags: - dc1 - dc2 notify: Nomad restarted - name: Nomad client2.hcl removed file: state: absent dest: /usr/local/etc/nomad/client2.hcl tags: - dc1 - dc2 notify: Nomad restarted - name: Nomad dns setup template: src: dnsmasq.conf.j2 dest: /usr/local/etc/dnsmasq.conf owner: root mode: 0644 tags: - dc1 - dc2 notify: Dnsmasq restarted - name: Nomad started service: name=nomad state=started tags: - dc1 - dc2