Compare commits
18 Commits
d140665cbf
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 652a5d25c9 | |||
| 8b30841fc4 | |||
| af4c3a1b08 | |||
| 51f36b921d | |||
| 5d279e0e86 | |||
| 567749e74d | |||
| 3b644541dd | |||
| d29e73a424 | |||
| ad38b34ce4 | |||
| 0a2cc82e2d | |||
| e27b3f1f6f | |||
| 963930e04d | |||
| 8463a257d6 | |||
| ad8df64b13 | |||
| d828b83e0b | |||
| 139629a458 | |||
| e220c2bc24 | |||
| 1ffdb79f41 |
@@ -34,10 +34,14 @@ steps:
|
||||
- |
|
||||
make deps-ova
|
||||
- |
|
||||
make build-node-ova-vsphere-ubuntu-2204 FOREGROUND=1 PACKER_LOG=1
|
||||
make build-node-ova-vsphere-ubuntu-2004
|
||||
- |
|
||||
mv -fv ./output/**/*.ova /output
|
||||
environment:
|
||||
VSPHERE_PASSWORD:
|
||||
from_secret: vsphere_password
|
||||
IB_OVFTOOL: true
|
||||
IB_OVFTOOL_ARGS: --allowExtraConfig
|
||||
volumes:
|
||||
- name: output
|
||||
path: /output
|
||||
|
||||
6
ansible/roles/custom/tasks/main.yml
Normal file
6
ansible/roles/custom/tasks/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
- name: Override cloud-init datasource list
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/cloud/cloud.cfg.d/90_dpkg.cfg
|
||||
content: |
|
||||
# To update this file, run dpkg-reconfigure cloud-init
|
||||
datasource_list: [ VMware, None ]
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"build_target": "virt",
|
||||
"disable_public_repos": "false",
|
||||
"extra_debs": "",
|
||||
"extra_debs": "open-iscsi",
|
||||
"extra_repos": "",
|
||||
"extra_rpms": "",
|
||||
"firstboot_custom_roles_post": "",
|
||||
@@ -9,9 +9,9 @@
|
||||
"http_proxy": "",
|
||||
"https_proxy": "",
|
||||
"no_proxy": "",
|
||||
"node_custom_roles_post": "",
|
||||
"node_custom_roles_post": "custom",
|
||||
"node_custom_roles_pre": "",
|
||||
"pause_image": "registry.k8s.io/pause:3.9",
|
||||
"pause_image": "registry.k8s.io/pause:3.6",
|
||||
"pip_conf_file": "",
|
||||
"redhat_epel_rpm": "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm",
|
||||
"reenable_public_repos": "true",
|
||||
|
||||
0
packer/ova/linux/ubuntu/http/20.04/meta-data
Normal file
0
packer/ova/linux/ubuntu/http/20.04/meta-data
Normal file
87
packer/ova/linux/ubuntu/http/20.04/user-data
Normal file
87
packer/ova/linux/ubuntu/http/20.04/user-data
Normal file
@@ -0,0 +1,87 @@
|
||||
#cloud-config
|
||||
# Copyright 2022 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# For more information on how autoinstall is configured, please refer to
|
||||
# https://ubuntu.com/server/docs/install/autoinstall-reference
|
||||
autoinstall:
|
||||
version: 1
|
||||
# Disable ssh server during installation, otherwise packer tries to connect and exceed max attempts
|
||||
early-commands:
|
||||
- systemctl stop ssh
|
||||
# Configure the locale
|
||||
locale: en_US.UTF-8
|
||||
keyboard:
|
||||
layout: us
|
||||
# Create a single-partition with no swap space. Kubernetes
|
||||
# really dislikes the idea of anyone else managing memory.
|
||||
# For more information on how partitioning is configured,
|
||||
# please refer to https://curtin.readthedocs.io/en/latest/topics/storage.html.
|
||||
storage:
|
||||
config:
|
||||
- type: disk
|
||||
id: disk-0
|
||||
size: largest
|
||||
grub_device: true
|
||||
preserve: false
|
||||
ptable: msdos
|
||||
wipe: superblock
|
||||
- type: partition
|
||||
id: partition-0
|
||||
device: disk-0
|
||||
size: -1
|
||||
number: 1
|
||||
preserve: false
|
||||
flag: boot
|
||||
- type: format
|
||||
id: format-0
|
||||
volume: partition-0
|
||||
fstype: ext4
|
||||
preserve: false
|
||||
- type: mount
|
||||
id: mount-0
|
||||
device: format-0
|
||||
path: /
|
||||
updates: 'all'
|
||||
ssh:
|
||||
install-server: true
|
||||
allow-pw: true
|
||||
# Customize the list of packages installed.
|
||||
packages:
|
||||
- open-vm-tools
|
||||
# Create the default user.
|
||||
# Ensures the "builder" user doesn't require a password to use sudo.
|
||||
user-data:
|
||||
users:
|
||||
- name: builder
|
||||
# openssl passwd -6 -stdin <<< builder
|
||||
passwd: $6$xyz$UtXVazU08Q5b8AW.TJ3MPYZglyXa3Ttf2RCel8MCUPlEYO1evWxeWBhZ2QqivU/Ij4tqYAxMCqc2ujEM4dMSe1
|
||||
groups: [adm, cdrom, dip, plugdev, lxd, sudo]
|
||||
lock-passwd: false
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
shell: /bin/bash
|
||||
|
||||
# This command runs after all other steps; it:
|
||||
# 1. Disables swapfiles
|
||||
# 2. Removes the existing swapfile
|
||||
# 3. Removes the swapfile entry from /etc/fstab
|
||||
# 4. Cleans up any packages that are no longer required
|
||||
# 5. Removes the cached list of packages
|
||||
late-commands:
|
||||
- swapoff -a
|
||||
- rm -f /swapfile
|
||||
- sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
|
||||
- apt-get purge --auto-remove -y
|
||||
- rm -rf /var/lib/apt/lists/*
|
||||
@@ -195,6 +195,7 @@
|
||||
"cpu_cores": "{{user `cpu_cores`}}",
|
||||
"datacenter": "{{user `datacenter`}}",
|
||||
"datastore": "{{user `datastore`}}",
|
||||
"destroy": true,
|
||||
"disk_controller_type": "{{user `disk_controller_type`}}",
|
||||
"export": {
|
||||
"force": true,
|
||||
@@ -220,7 +221,7 @@
|
||||
}
|
||||
],
|
||||
"password": "{{user `password`}}",
|
||||
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c 'usermod -L {{user `ssh_username`}} && {{user `shutdown_command`}}'",
|
||||
"shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E sh -c '{{user `shutdown_command`}}'",
|
||||
"ssh_password": "{{user `ssh_password`}}",
|
||||
"ssh_timeout": "4h",
|
||||
"ssh_username": "{{user `ssh_username`}}",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"boot_disable_ipv6": "0",
|
||||
"boot_media_path": "/media/HTTP",
|
||||
"build_name": "ubuntu-2004",
|
||||
"cd_file_path": "./packer/ova/linux/{{user `distro_name`}}/http/{{user `distro_version`}}",
|
||||
"distro_arch": "amd64",
|
||||
"distro_name": "ubuntu",
|
||||
"distro_version": "20.04",
|
||||
|
||||
Reference in New Issue
Block a user