34 lines
724 B
YAML
34 lines
724 B
YAML
|
---
|
||
|
- name: Include OS-specific variables
|
||
|
include_vars: "{{ item }}"
|
||
|
with_first_found:
|
||
|
- files:
|
||
|
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
|
||
|
- "{{ ansible_os_family }}.yml"
|
||
|
|
||
|
- name: install package
|
||
|
package:
|
||
|
name: "{{ nomad_os_package }}"
|
||
|
state: present
|
||
|
|
||
|
- name: create folder
|
||
|
file:
|
||
|
state: directory
|
||
|
mode: 0755
|
||
|
path: "{{nomad_data_dir }}"
|
||
|
|
||
|
- name: apply config template
|
||
|
block:
|
||
|
- name: server template
|
||
|
template:
|
||
|
src: config.hcl.j2
|
||
|
dest: /etc/nomad.d/config.hcl
|
||
|
mode: 0400
|
||
|
notify: restart nomad
|
||
|
|
||
|
- name: ensure service is started
|
||
|
systemd:
|
||
|
name: "{{ nomad_os_service }}"
|
||
|
state: started
|
||
|
enabled: True
|