variable username

This commit is contained in:
Thorsten Müller
2021-04-27 14:41:34 +02:00
parent c0d8f609fa
commit f5281eaffc
6 changed files with 9 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ all:
ansible_host: ed-c7-1.virt.magni.thoto.net
ssh_args: -o ControlMaster=auto -o ControlPersist=60s
# ansible_host: 192.168.122.139
unpriv_user: thoto
children:
htcondor:
hosts:

View File

@@ -2,14 +2,14 @@
file:
path: "/container/docker-images/htcondor"
state: directory
owner: thoto
owner: "{{unpriv_user}}"
group: docker
mode: "u=rwx,g=rwx,o=rx"
- copy:
dest: "/container/docker-images/htcondor/Dockerfile"
src: "htcondor.Dockerfile"
owner: thoto
owner: "{{unpriv_user}}"
group: docker
register: cp_dockerfile
@@ -26,7 +26,7 @@
copy:
src: "conf/{{item}}/"
dest: "/container/volumes/{{item}}/"
owner: thoto
owner: "{{unpriv_user}}"
group: docker
mode: "u=rwx,g=rwx"
with_items: [ "cm", "exec", "sub", "common"]

View File

@@ -51,6 +51,6 @@
- name: "fix user privileges to run docker"
user:
name: thoto
name: "{{unpriv_user}}"
groups: docker
append: True

View File

@@ -1,13 +1,13 @@
- file:
path: "/container/docker-images/{{item}}"
state: directory
owner: thoto
owner: "{{unpriv_user}}"
group: docker
- copy:
src: "{{item}}.Dockerfile"
dest: "/container/docker-images/{{item}}/Dockerfile"
owner: thoto
owner: "{{unpriv_user}}"
group: docker
register: slurm_cp_dockerfile

View File

@@ -62,7 +62,7 @@
- machine: submit1
image: slurm-slurmd
extra_mounts:
- "/home/thoto/job3/:/mnt/:rw"
- "/home/{{unpriv_user}}/job3/:/mnt/:rw"
tags: [ slurm-config ]
# TODO: reserve some address using docker_network_info and assign as aux

View File

@@ -10,7 +10,7 @@
- name: "enable user thoto for fakeroot access"
lineinfile:
line: "thoto:4294836224:65536"
line: "{{unpriv_user}}:4294836224:65536"
dest: "{{item}}"
with_items: ["/etc/subuid", "/etc/subgid"]
# the task above idempotentially does the same as: