Add doc/examples with an example

Signed-off-by: Ana Guerrero Lopez <ana.guerrero@collabora.com>
This commit is contained in:
Ana Guerrero Lopez
2018-06-06 22:19:56 +02:00
committed by Sjoerd Simons
parent b19980c41a
commit cd486ecb6d
3 changed files with 45 additions and 0 deletions

34
doc/examples/example.yaml Normal file
View File

@@ -0,0 +1,34 @@
{{- $architecture := or .architecture "arm64" -}}
{{- $suite := or .suite "stretch" -}}
{{ $image := or .image (printf "debian-%s-%s.tgz" $suite $architecture) }}
architecture: {{ $architecture }}
actions:
- action: debootstrap
suite: "buster"
components:
- main
- contrib
- non-free
mirror: https://deb.debian.org/debian
variant: minbase
- action: apt
description: Install some packages
packages: [ sudo, openssh-server, adduser, systemd-sysv, firmware-linux ]
- action: run
chroot: true
script: setup-user.sh
- action: overlay
source: overlays/sudo
- action: run
chroot: true
command: echo debian > /etc/hostname
- action: pack
file: {{ $image }}
compression: gz

View File

@@ -0,0 +1 @@
%sudo ALL=(ALL) NOPASSWD: /usr/bin/su

10
doc/examples/setup-user.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
set -e
echo "I: create user"
adduser --gecos User user
echo "I: set user password"
echo "user:user" | chpasswd
adduser user sudo