aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2020-06-10 08:05:37 +0000
committerpmikus <pmikus@cisco.com>2020-06-10 08:05:37 +0000
commite2e696735bc71114327361b5001561e6776a431b (patch)
tree3556a00458a2164123d5b9d782bdf9a684db75ff
parent61012e6fc1590376b327ebdc026be8278a277611 (diff)
Infra: Ansible speed up
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I24a22b1492593df937af2a17cd0c8684af7cd500
-rw-r--r--resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml4
-rw-r--r--resources/tools/testbed-setup/ansible/roles/nomad/tasks/main.yaml7
-rw-r--r--resources/tools/testbed-setup/ansible/roles/nomad/templates/nomad_systemd.service.j218
3 files changed, 10 insertions, 19 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
index d3eef82781..f0cb0d19cf 100644
--- a/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
@@ -9,8 +9,6 @@
package:
name: "{{ docker_package }}"
state: "{{ docker_package_state }}"
- notify:
- - "Restart Docker"
tags:
- docker-inst-package
@@ -68,5 +66,3 @@
when: docker_users
tags:
- docker-conf-user
-
-- meta: flush_handlers
diff --git a/resources/tools/testbed-setup/ansible/roles/nomad/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/nomad/tasks/main.yaml
index a8bf90f000..cd52b929bf 100644
--- a/resources/tools/testbed-setup/ansible/roles/nomad/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/nomad/tasks/main.yaml
@@ -58,13 +58,6 @@
tags:
- nomad-inst-package
-- name: Inst - Cleanup
- file:
- path: "{{ nomad_inst_dir }}/nomad"
- state: "absent"
- tags:
- - nomad-inst-package
-
- name: Conf - Create Directories "{{ nomad_data_dir }}"
file:
dest: "{{ nomad_data_dir }}"
diff --git a/resources/tools/testbed-setup/ansible/roles/nomad/templates/nomad_systemd.service.j2 b/resources/tools/testbed-setup/ansible/roles/nomad/templates/nomad_systemd.service.j2
index 7652983417..efe2e30bd6 100644
--- a/resources/tools/testbed-setup/ansible/roles/nomad/templates/nomad_systemd.service.j2
+++ b/resources/tools/testbed-setup/ansible/roles/nomad/templates/nomad_systemd.service.j2
@@ -1,19 +1,21 @@
[Unit]
Description=Nomad Service
-Documentation=https://www.nomadproject.io/docs/index.html
-Wants=network.target
-After=nomad.service
+Documentation=https://www.nomadproject.io/docs/
+Wants=network-online.target
+After=network-online.target
[Service]
# TODO: Decrease privilege
-User=root
-Group=root
-Environment="GOMAXPROCS=2"
+ExecReload=/bin/kill -SIGKILL $MAINPID
ExecStart={{ nomad_bin_dir }}/nomad agent -config={{ nomad_config_dir }}
-ExecReload=/bin/kill -9 $MAINPID
KillSignal=SIGTERM
+LimitNOFILE=infinity
+LimitNPROC=infinity
Restart=on-failure
RestartSec=1
+User=root
+Group=root
+Environment="GOMAXPROCS=2"
[Install]
-WantedBy=default.target
+WantedBy=multi-user.target