Skip to content

Commit b6806b9

Browse files
authored
Merge pull request #1838 from sriramandev/topic/ssriraman/1837
fix: builder user remenants should not be present in node images
2 parents e692d30 + 8910179 commit b6806b9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

images/capi/packer/maas/packer.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"net_device": "virtio-net",
3030
"output_directory": "{{user `output_directory`}}",
3131
"qemu_binary": "{{user `qemu_binary`}}",
32-
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'usermod -L {{user `ssh_username`}} && {{user `shutdown_command`}}'",
32+
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'userdel -f -r {{user `ssh_username`}} && rm -f /etc/sudoers.d/{{user `ssh_username` }} && rm -f /etc/sudoers.d/90-cloud-init-users && {{user `shutdown_command`}}'",
3333
"ssh_password": "{{user `ssh_password`}}",
3434
"ssh_timeout": "2h",
3535
"ssh_username": "{{user `ssh_username`}}",

images/capi/packer/nutanix/packer.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"nutanix_port": "{{user `nutanix_port`}}",
1717
"nutanix_username": "{{user `nutanix_username`}}",
1818
"os_type": "{{user `guest_os_type`}}",
19-
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'usermod -L {{user `ssh_username`}} && {{user `shutdown_command`}}'",
19+
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'userdel -f -r {{user `ssh_username`}} && rm -f /etc/sudoers.d/{{user `ssh_username` }} && rm -f /etc/sudoers.d/90-cloud-init-users && {{user `shutdown_command`}}'",
2020
"ssh_handshake_attempts": "100",
2121
"ssh_password": "{{user `ssh_password`}}",
2222
"ssh_timeout": "20m",

images/capi/packer/qemu/packer.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"net_device": "virtio-net",
3030
"output_directory": "{{user `output_directory`}}",
3131
"qemu_binary": "{{user `qemu_binary`}}",
32-
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'usermod -L {{user `ssh_username`}} && {{user `shutdown_command`}}'",
32+
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'userdel -f -r {{user `ssh_username`}} && rm -f /etc/sudoers.d/{{user `ssh_username` }} && rm -f /etc/sudoers.d/90-cloud-init-users && {{user `shutdown_command`}}'",
3333
"ssh_password": "{{user `ssh_password`}}",
3434
"ssh_timeout": "2h",
3535
"ssh_username": "{{user `ssh_username`}}",

images/capi/packer/raw/packer.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"virtio"
3131
]
3232
],
33-
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'usermod -L {{user `ssh_username`}} && {{user `shutdown_command`}}'",
33+
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'userdel -f -r {{user `ssh_username`}} && rm -f /etc/sudoers.d/{{user `ssh_username` }} && rm -f /etc/sudoers.d/90-cloud-init-users && {{user `shutdown_command`}}'",
3434
"ssh_handshake_attempts": "100",
3535
"ssh_password": "{{user `ssh_password`}}",
3636
"ssh_timeout": "2h",

0 commit comments

Comments
 (0)