piston/container/piston.yaml

355 lines
7.3 KiB
YAML
Raw Normal View History

2021-01-28 10:20:08 +01:00
image:
2021-01-28 11:10:55 +01:00
name: ubuntu-bionic-x86_64-piston
2021-01-28 10:20:08 +01:00
distribution: ubuntu
2021-01-28 11:10:55 +01:00
release: bionic
2021-01-28 10:20:08 +01:00
description: |-
Ubuntu {{ image.release }} preconfigured for Piston
architecture: x86_64
source:
downloader: debootstrap
2021-01-28 11:10:55 +01:00
same_as: bionic
2021-01-28 10:20:08 +01:00
url: http://archive.ubuntu.com/ubuntu
keyserver: keyserver.ubuntu.com
keys:
- '0x790BC7277767219C42C86F933B4FE6ACC0B21F32'
- '0xf6ecb3762474eda9d21b7022871920d1991bc93c'
targets:
lxc:
create-message: |-
You just created an {{ image.description }} container.
To enable SSH, run: apt install openssh-server
No default root or user password are set by LXC.
config:
- type: all
before: 5
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf
- type: user
before: 5
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf
- type: all
after: 4
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/common.conf
# For Ubuntu 14.04
lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0
lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0
lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0
lxc.mount.entry = mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0
- type: user
after: 4
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/userns.conf
# For Ubuntu 14.04
lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0
lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0
- type: all
content: |-
lxc.arch = {{ image.architecture_personality }}
files:
- path: /etc/hostname
generator: hostname
- path: /etc/hosts
generator: hosts
- path: /etc/resolvconf/resolv.conf.d/original
generator: remove
- path: /etc/resolvconf/resolv.conf.d/tail
generator: remove
- path: /etc/machine-id
generator: dump
- path: /var/lib/dbus/machine-id
generator: remove
- path: /etc/netplan/10-lxc.yaml
generator: dump
content: |-
network:
version: 2
ethernets:
eth0:
dhcp4: true
dhcp-identifier: mac
releases:
- bionic
- eoan
- focal
- groovy
types:
- container
variants:
- default
- path: /etc/network/interfaces
generator: dump
content: |-
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
source /etc/network/interfaces.d/*.cfg
releases:
- trusty
- xenial
types:
- container
- path: /etc/netplan/10-lxc.yaml
generator: dump
content: |-
network:
version: 2
ethernets:
enp5s0:
dhcp4: true
dhcp-identifier: mac
releases:
- bionic
- eoan
- focal
- groovy
types:
- vm
variants:
- default
- path: /etc/network/interfaces
generator: dump
content: |-
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto enp5s0
iface enp5s0 inet dhcp
source /etc/network/interfaces.d/*.cfg
releases:
- trusty
- xenial
types:
- vm
- path: /etc/init/lxc-tty.conf
generator: upstart-tty
releases:
- trusty
types:
- container
- name: meta-data
generator: cloud-init
variants:
- cloud
- name: network-config
generator: cloud-init
variants:
- cloud
- name: user-data
generator: cloud-init
variants:
- cloud
- name: vendor-data
generator: cloud-init
variants:
- cloud
- name: ext4
generator: fstab
types:
- vm
- name: lxd-agent
generator: lxd-agent
types:
- vm
- path: /etc/default/grub.d/50-lxd.cfg
generator: dump
content: |-
GRUB_RECORDFAIL_TIMEOUT=0
GRUB_TIMEOUT=0
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0"
GRUB_TERMINAL=console
types:
- vm
- path: /etc/sudoers.d/90-lxd
generator: dump
mode: '0440'
content: |-
# User rules for ubuntu
ubuntu ALL=(ALL) NOPASSWD:ALL
variants:
- default
packages:
manager: apt
update: true
cleanup: true
sets:
- packages:
- apt-transport-https
- fuse
- language-pack-en
- openssh-client
- vim
action: install
- packages:
- cloud-init
action: install
variants:
- cloud
- packages:
- acpid
action: install
architectures:
- amd64
- arm64
types:
- vm
- packages:
- grub-efi-amd64-signed
- shim-signed
action: install
architectures:
- amd64
types:
- vm
- packages:
- grub-efi-arm64-signed
action: install
architectures:
- arm64
types:
- vm
- packages:
- shim-signed
action: install
architectures:
- arm64
releases:
- disco
- eoan
- focal
- groovy
types:
- vm
- packages:
- linux-virtual-hwe-16.04
action: install
releases:
- xenial
types:
- vm
- packages:
- linux-virtual
action: install
releases:
- bionic
- eoan
- focal
- groovy
types:
- vm
- packages:
- os-prober
action: remove
types:
- vm
repositories:
- name: sources.list
url: |-
deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse
architectures:
- amd64
- i386
- name: sources.list
url: |-
deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }} main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-updates main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-security main restricted universe multiverse
architectures:
- armhf
- arm64
- powerpc
- powerpc64
- ppc64el
actions:
- trigger: post-update
action: |-
#!/bin/sh
set -eux
# Create the ubuntu user account
getent group sudo >/dev/null 2>&1 || groupadd --system sudo
useradd --create-home -s /bin/bash -G sudo -U ubuntu
variants:
- default
- trigger: post-packages
action: |-
#!/bin/sh
set -eux
# Enable systemd-networkd
systemctl enable systemd-networkd
releases:
- bionic
- eoan
- focal
- groovy
- trigger: post-packages
action: |-
#!/bin/sh
set -eux
# Make sure the locale is built and functional
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
# Cleanup underlying /run
mount -o bind / /mnt
rm -rf /mnt/run/*
umount /mnt
# Cleanup temporary shadow paths
rm /etc/*-
- trigger: post-files
action: |-
#!/bin/sh
set -eux
TARGET="x86_64"
[ "$(uname -m)" = "aarch64" ] && TARGET="arm64"
update-grub
grub-install --uefi-secure-boot --target="${TARGET}-efi" --no-nvram --removable
update-grub
sed -i "s#root=[^ ]*#root=/dev/sda2#g" /boot/grub/grub.cfg
types:
- vm
mappings:
architecture_map: debian