Skip to content

Commit ff3441d

Browse files
Build ubuntu22/24 images (#23)
* Initial changes NO_JIRA * update playbook NO_JIRA * linting NO_JIRA * Update ubuntu2204.pkrvars.hcl * Support latest ubuntu 24 install NO_JIRA * Fix bootcommand NO_JIRA
1 parent ec5b52d commit ff3441d

24 files changed

+193
-615
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/packer_cache
22
/output
33
vsphere-environment-do-not-add
4+
/ansible_provisioning/roles

ansible_provisioning/playbook.yaml

+3-16
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,9 @@
1111
- role: ccdc.install-vm-tools
1212
- role: devsec.hardening.ssh_hardening
1313
vars:
14-
os_vars: {}
15-
sshd_authenticationmethods: publickey,keyboard-interactive
16-
ssh_host_keys_dir: /etc/ssh
17-
sshd_path: /usr/sbin/sshd
18-
sshd_moduli_file: /etc/ssh/moduli
19-
ssh_owner: root
20-
ssh_group: wheel
21-
ssh_host_keys_owner: root
22-
ssh_host_keys_group: wheel
23-
ssh_host_keys_mode: "0600"
24-
ssh_pam_support: false
25-
ssh_kerberos_support: false
26-
ssh_gssapi_support: false
27-
ssh_client_compression: true
14+
sshd_authenticationmethods: publickey password
2815
ssh_client_password_login: true
2916
ssh_server_password_login: true
30-
ssh_challengeresponseauthentication: true
31-
sshd_disable_crypto_policy: false
17+
ssh_kerberos_support: false
18+
ssh_pam_support: false
3219
- role: ccdc.compact-vm-image

ansible_provisioning/requirements.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,5 @@ roles:
99
- src: git@github.com:ccdc-opensource/ansible-role-compact-vm-image
1010
scm: git
1111
name: ccdc.compact-vm-image
12-
- src: https://github.com/feffi/ansible-macos-standby.git
13-
name: feffi.macos-standby
14-
- src: https://github.com/florianpiesche/ansible-macos-defaults/
15-
version: patch-1
16-
name: feffi.macos-defaults
17-
1812
collections:
1913
- devsec.hardening

build-vsphere.sh

+6-13
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44
pushd $DIR
55

6-
if [[ -f /proc/version ]] && [[ "$( grep Microsoft /proc/version )" ]]; then
7-
PACKER="packer.exe"
8-
else
6+
# if [[ -f /proc/version ]] && [[ "$( grep Microsoft /proc/version )" ]]; then
7+
# PACKER="packer.exe"
8+
# else
99
PACKER="packer"
10-
fi
10+
# fi
1111

1212
if [[ ! -e ./vsphere-environment-do-not-add ]]
1313
then
@@ -23,14 +23,7 @@ rm -rf ./output/packer-ubuntu-22.04-amd64-vmware
2323

2424
echo 'building base images'
2525
$PACKER build \
26-
-only=vmware-iso \
2726
-except=vagrant \
28-
-var 'customise_for_buildmachine=1' \
29-
-var 'build_directory=./output/' \
30-
-var 'disk_size=200000' \
31-
-var 'cpus=2' \
32-
-var 'memory=4096' \
33-
-var 'vmx_remove_ethernet_interfaces=false' \
34-
-var 'box_basename=ccdc-basebox/ubuntu-22.04' \
35-
./ubuntu-22.04-amd64.json
27+
-var-file=ubuntu2204.pkrvars.hcl \
28+
.
3629

http/user-data

+27-39
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,34 @@
11
#cloud-config
2-
chpasswd:
3-
expire: false
4-
list:
5-
- installer:$1$vHRSqO5j$9BU7DaZGdW.28BGJ7LNhc1
6-
ssh_authorized_keys:
7-
- ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQBjdgsKMvOSEGdtJ/oANgHtkr/bLdjI0zzk1WJKgq5mfw6OiD5vCc4mWM9P7KZOndLc7G3NB0ijQSgQ37PT99f2cHpzs6jTKi+OoAAhfeNImr/j+7KV3zJlFPXOBA0qdWQnSRp/HJNoNfL5AtcMPwaEIFy06kzKYS/Ukt80stzMOIcEGTh9Zw5H2Kag7x0CbZVXyh5Um3SuSw9uR2+BSDrnZBws9BVa6e3mNIZQQVM0508YcU0KyxZN2ablinipO/XrmwHOUzxvn98KsEv43dqXTV9IaE2dAr6H9cFhiTi9hnMQZhY/N8PHbiE8dVL7hNhmBJGDcgAkFW7HRgbKvzbJ installer
82
autoinstall:
93
version: 1
10-
early-commands:
11-
- systemctl stop ssh # otherwise packer tries to connect and exceed max attempts
12-
debconf-selections: |
13-
choose-mirror-bin mirror/http/proxy string
14-
tasksel tasksel/first multiselect standard, server
15-
packages:
16-
- cryptsetup
17-
- build-essential
18-
- libssl-dev
19-
- libreadline-dev
20-
- zlib1g-dev
21-
- linux-source
22-
- dkms
23-
- nfs-common
24-
- linux-headers-generic
25-
- perl
26-
- cifs-utils
27-
- software-properties-common
28-
- rsync
29-
- ifupdown
304
identity:
31-
hostname: ccdc-ubuntu2204-test
32-
password: $1$vHRSqO5j$9BU7DaZGdW.28BGJ7LNhc1
33-
realname: vagrant
5+
hostname: vagrant
346
username: vagrant
35-
locale: en_GB.UTF-8
36-
keyboard:
37-
layout: uk
38-
variant: UK
7+
password: '$6$rounds=4096$5CU3LEj/MQvbkfPb$LmKEF9pCfU8R.dA.GemgE/8GT6r9blge3grJvdsVTMFKyLEQwzEF3SGWqAzjawY/XHRpWj4fOiLBrRyxJhIRJ1'
8+
early-commands:
9+
# otherwise packer tries to connect and exceed max attempts:
10+
- systemctl stop ssh.service
11+
- systemctl stop ssh.socket
12+
package_upgrade: true
13+
packages:
14+
- cryptsetup
15+
- build-essential
16+
- libssl-dev
17+
- libreadline-dev
18+
- zlib1g-dev
19+
- linux-source
20+
- dkms
21+
- nfs-common
22+
- linux-headers-generic
23+
- perl
24+
- cifs-utils
25+
- software-properties-common
26+
- rsync
27+
- ifupdown
3928
ssh:
40-
install-server: true
41-
allow-pw: true
42-
user-data:
43-
timezone: UTC
29+
install-server: yes
30+
allow-pw: yes
4431
late-commands:
45-
- curtin in-target --target=/target -- apt update
46-
- curtin in-target --target=/target -- apt upgrade -y
32+
- curtin in-target --target=/target -- apt update
33+
- curtin in-target --target=/target -- apt upgrade -y
34+
- echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/vagrant

scripts/cleanup.sh

-81
This file was deleted.

scripts/customisation-for-buildmachines.sh

-59
This file was deleted.

scripts/hyperv.sh

-12
This file was deleted.

scripts/metadata.sh

-6
This file was deleted.

scripts/minimize.sh

-36
This file was deleted.

scripts/motd.sh

-21
This file was deleted.

scripts/networking.sh

-25
This file was deleted.

0 commit comments

Comments
 (0)