Basic setup for nomad container users/groups

This commit is contained in:
Amarpreet Minhas 2020-10-03 17:22:04 -04:00
parent dce8d35fe4
commit e10b2a5172
4 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,10 @@
---
nomad_meta_values:
- { name: "long_lived", value: "true" }
nomad_ug_map:
- { name: "jenkins", id: "15000" }
nomad_bind_mounts:
- { path: /opt/jenkins_home, owner: jenkins }
...

View file

@ -0,0 +1,24 @@
---
- name: setup group mappings
group:
name: "{{ item.name }}"
gid: "{{ item.id }}"
system: True
loop: "{{ nomad_ug_map }}"
- name: setup user mappings
user:
name: "{{ item.name }}"
uid: "{{ item.id }}"
system: True
loop: "{{ nomad_ug_map }}"
- name: ensure mounts
file:
state: directory
path: "{{ item.path }}"
owner: "{{ item.owner }}"
group: "{{ item.owner }}"
mode: 0755
loop: "{{ nomad_bind_mounts }}"
...

View file

@ -1,4 +1,5 @@
--- ---
- import_tasks: podman_prep.yml - import_tasks: podman_prep.yml
- import_tasks: nomad.yml - import_tasks: nomad.yml
- import_tasks: client_setup.yml
... ...

View file

@ -3,6 +3,11 @@ data_dir = "/opt/nomad"
client { client {
enabled = true enabled = true
meta {
{% for nomad_meta in nomad_meta_values %}
"{{ nomad_meta.name }}" = "{{ nomad_meta.value }}"
{% endfor %}
}
} }
consul { consul {