Basic setup for nomad container users/groups
This commit is contained in:
parent
dce8d35fe4
commit
e10b2a5172
4 changed files with 40 additions and 0 deletions
10
ansible/host_vars/sedan.minhas.io/nomad.yml
Normal file
10
ansible/host_vars/sedan.minhas.io/nomad.yml
Normal 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 }
|
||||
...
|
24
ansible/roles/nomad_client/tasks/client_setup.yml
Normal file
24
ansible/roles/nomad_client/tasks/client_setup.yml
Normal 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 }}"
|
||||
...
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
- import_tasks: podman_prep.yml
|
||||
- import_tasks: nomad.yml
|
||||
- import_tasks: client_setup.yml
|
||||
...
|
||||
|
|
|
@ -3,6 +3,11 @@ data_dir = "/opt/nomad"
|
|||
|
||||
client {
|
||||
enabled = true
|
||||
meta {
|
||||
{% for nomad_meta in nomad_meta_values %}
|
||||
"{{ nomad_meta.name }}" = "{{ nomad_meta.value }}"
|
||||
{% endfor %}
|
||||
}
|
||||
}
|
||||
|
||||
consul {
|
||||
|
|
Loading…
Reference in a new issue