Remove hardcoded user in packer provisionning

This commit is contained in:
Samuel Aubertin 2023-10-09 12:21:07 +02:00
parent 854982082a
commit 1f06ba238f
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ define OPACK_PACKER_CLOUD_CONTENT =
},
{
"type": "shell",
"inline": ["cp /root/.ssh/authorized_keys /home/opack/.ssh/authorized_keys; chown opack /home/opack/.ssh/authorized_keys"]
"inline": ["cp /root/.ssh/authorized_keys /home/$(OPACK_SYS_USER)/.ssh/authorized_keys; chown $(OPACK_SYS_USER) /home/$(OPACK_SYS_USER)/.ssh/authorized_keys"]
}
],
"post-processors": [ [

View File

@ -48,7 +48,7 @@ define OPACK_PACKER_CONTENT =
},
{
"type": "shell",
"inline": ["cp /root/.ssh/authorized_keys /home/opack/.ssh/authorized_keys; chown opack /home/opack/.ssh/authorized_keys"]
"inline": ["cp /root/.ssh/authorized_keys /home/$(OPACK_SYS_USER)/.ssh/authorized_keys; chown $(OPACK_SYS_USER) /home/$(OPACK_SYS_USER)/.ssh/authorized_keys"]
}
],
"post-processors": [ [