diff --git a/roles/nummer5/files/nomad.hcl.j2 b/roles/nummer5/files/nomad.hcl.j2 new file mode 100644 index 0000000..5ba720d --- /dev/null +++ b/roles/nummer5/files/nomad.hcl.j2 @@ -0,0 +1,24 @@ +### +# Ansible +## + +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +# Full configuration options can be found at https://www.nomadproject.io/docs/configuration + +data_dir = "/opt/nomad/data" +bind_addr = "{{ ansible_facts['default_ipv4']['address'] }}" +datacenter = "nummer5" + +server { + enabled = true + bootstrap_expect = 3 +} + +client { + enabled = true + servers = ["{{ ansible_facts['default_ipv4']['address'] }}"] + network_interface = "{{ ansible_facts['default_ipv4']['interface'] }}" + node_pool = "{{ nomad_pool }}" +} diff --git a/roles/nummer5/tasks/nomad.yaml b/roles/nummer5/tasks/nomad.yaml index 2212c92..a062533 100644 --- a/roles/nummer5/tasks/nomad.yaml +++ b/roles/nummer5/tasks/nomad.yaml @@ -3,4 +3,18 @@ state: present name: - nomad - - nomad-driver-podman \ No newline at end of file + - nomad-driver-podman + +- name: Configure Nomad telemetry + register: conf_update + copy: + src: telemetry.hcl + dest: /etc/nomad.d/telemetry.hcl + +- name: Configure Nomad + register: conf_update + template: + src: files/nomad.hcl.j2 + dest: /tmp/nomad.hcl + + \ No newline at end of file diff --git a/roles/podman/files/storage.conf b/roles/podman/files/storage.conf index 10ad93e..2ddce8e 100644 --- a/roles/podman/files/storage.conf +++ b/roles/podman/files/storage.conf @@ -179,7 +179,7 @@ mountopt = "nodev" # If the thinpool is in use when the driver attempts to remove it, the driver # tells the kernel to remove it as soon as possible. Note this does not free # up the disk space, use deferred deletion to fully remove the thinpool. -# use_deferred_removal = "True" +use_deferred_removal = "True" # use_deferred_deletion marks thinpool device for deferred deletion. # If the device is busy when the driver attempts to delete it, the driver @@ -187,7 +187,7 @@ mountopt = "nodev" # If the program using the driver exits, the driver will continue attempting # to cleanup the next time the driver is used. Deferred deletion permanently # deletes the device and all data stored in device will be lost. -# use_deferred_deletion = "True" +use_deferred_deletion = "True" # xfs_nospace_max_retries specifies the maximum number of retries XFS should # attempt to complete IO when ENOSPC (no space) error is returned by diff --git a/roles/podman/tasks/main.yaml b/roles/podman/tasks/main.yaml index eea99cd..076a612 100644 --- a/roles/podman/tasks/main.yaml +++ b/roles/podman/tasks/main.yaml @@ -8,6 +8,7 @@ - containernetworking-plugins - crun - fuse-overlayfs + - slirp4netns - name: Disable Docker Emulation warning file: @@ -22,6 +23,11 @@ dest: /etc/containers/containers.conf src: containers.conf +- name: Configure storage.conf + copy: + dest: /etc/containers/storage.conf + src: storage.conf + - name: Configure cr.wks registry copy: dest: /etc/containers/registries.conf.d/cr.wks.conf diff --git a/site.yaml b/site.yaml index e913769..97169ed 100644 --- a/site.yaml +++ b/site.yaml @@ -5,11 +5,66 @@ - role: common tags: common -- hosts: ~pine.*\.wks +- hosts: pine01.wks + vars: + nomad_pool: sys roles: - role: nummer5 tags: nummer5 - role: armbian tags: armbian - role: debian - tags: debian \ No newline at end of file + tags: debian + +- hosts: pine02.wks + vars: + nomad_pool: apps + roles: + - role: nummer5 + tags: nummer5 + - role: armbian + tags: armbian + - role: debian + tags: debian + +- hosts: pine03.wks + vars: + nomad_pool: apps + roles: + - role: nummer5 + tags: nummer5 + - role: armbian + tags: armbian + - role: debian + tags: debian + +- hosts: pine04.wks + vars: + nomad_pool: apps + roles: + - role: nummer5 + tags: nummer5 + - role: armbian + tags: armbian + - role: debian + tags: debian + +- hosts: pine05.wks + vars: + nomad_pool: sys + roles: + - role: nummer5 + tags: nummer5 + - role: armbian + tags: armbian + - role: debian + tags: debian + +#- hosts: ~pine.*\.wks +# roles: +# - role: nummer5 +# tags: nummer5 +# - role: armbian +# tags: armbian +# - role: debian +# tags: debian \ No newline at end of file