-
Notifications
You must be signed in to change notification settings - Fork 311
/
user-data.pkrtpl.hcl
45 lines (42 loc) · 1.19 KB
/
user-data.pkrtpl.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#cloud-config
# Copyright 2023-2024 Broadcom. All rights reserved.
# SPDX-License-Identifier: BSD-2
# Ubuntu Server 34.04 LTS
autoinstall:
version: 1
apt:
geoip: true
preserve_sources_list: false
primary:
- arches: [amd64, i386]
uri: http:https://archive.ubuntu.com/ubuntu
- arches: [default]
uri: http:https://ports.ubuntu.com/ubuntu-ports
early-commands:
- sudo systemctl stop ssh
locale: ${vm_guest_os_language}
keyboard:
layout: ${vm_guest_os_keyboard}
${storage}
${network}
identity:
hostname: ubuntu-server
username: ${build_username}
password: ${build_password_encrypted}
ssh:
install-server: true
allow-pw: true
packages:
- openssh-server
- open-vm-tools
- cloud-init
%{ for package in additional_packages ~}
- ${package}
%{ endfor ~}
user-data:
disable_root: false
timezone: ${vm_guest_os_timezone}
late-commands:
- sed -i -e 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config
- echo '${build_username} ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/${build_username}
- curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/${build_username}