Skip to content

Commit

Permalink
ansible: add Nomad systemd service file to install. (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasell authored Jun 3, 2024
1 parent 5a3f90f commit 4e1ffce
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions shared/ansible/hashicorp/nomad_bench/roles/nomad/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

- name: "create_service_file"
become: true
ansible.builtin.template:
src: "nomad.service.j2"
dest: "/etc/systemd/system/nomad.service"
owner: "root"
group: "root"
mode: "0755"
notify:
- "reload_systemd"

- name: "check_nomad_checksum_file"
ansible.builtin.stat:
path: "/tmp/nomad_{{ nomad_version }}_SHA256SUMS"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[Unit]
Description=Nomad
Documentation=https://www.nomadproject.io/docs/
Wants=network-online.target
After=network-online.target

[Service]
User={{ nomad_user }}
Group={{ nomad_group }}

ExecReload=/bin/kill -HUP $MAINPID
ExecStart={{ nomad_install_dir }}/nomad agent -config {{ nomad_config_dir }}
KillMode=process
KillSignal=SIGINT
LimitNOFILE=65536
LimitNPROC=infinity
Restart=on-failure
RestartSec=2

TasksMax=infinity
OOMScoreAdjust=-1000

[Install]
WantedBy=multi-user.target

0 comments on commit 4e1ffce

Please sign in to comment.