Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos.package
Commits
fdebd6b1
Commit
fdebd6b1
authored
Nov 08, 2017
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: add debian9 image
parent
043ad231
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
0 deletions
+116
-0
packer/build-vm-bootstrap.yml
packer/build-vm-bootstrap.yml
+23
-0
packer/debian9.json
packer/debian9.json
+68
-0
packer/http/preseed-debian9.cfg
packer/http/preseed-debian9.cfg
+9
-0
packer/scripts/network-debian9.sh
packer/scripts/network-debian9.sh
+13
-0
packer/scripts/update.sh
packer/scripts/update.sh
+3
-0
No files found.
packer/build-vm-bootstrap.yml
View file @
fdebd6b1
...
@@ -29,6 +29,14 @@
...
@@ -29,6 +29,14 @@
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
script
:
"
scripts/vm-bootstrap.sh"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
script
:
"
scripts/vm-bootstrap.sh"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
script
:
"
scripts/vm-bootstrap.sh"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
script
:
"
scripts/vm-bootstrap.sh"
}
-
shell
:
PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' debian9.json >> log/debian9-{{ item.name }}.log
args
:
creates
:
output-debian9-{{ item.size }}G-{{ item.name }}
with_items
:
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
script
:
"
scripts/vm-bootstrap.sh"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
script
:
"
scripts/vm-bootstrap.sh"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
script
:
"
scripts/vm-bootstrap.sh"
}
-
shell
:
PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' ubuntu-14.04-server-amd64.json >> log/ubuntu-14-server-amd64-{{ item.name }}.log
-
shell
:
PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' ubuntu-14.04-server-amd64.json >> log/ubuntu-14-server-amd64-{{ item.name }}.log
args
:
args
:
creates
:
output-ubuntu-14-server-{{ item.size }}G-{{ item.name }}
creates
:
output-ubuntu-14-server-{{ item.size }}G-{{ item.name }}
...
@@ -90,6 +98,15 @@
...
@@ -90,6 +98,15 @@
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
}
ignore_errors
:
True
ignore_errors
:
True
-
shell
:
gzip output-debian9-{{ item.size }}G-{{ item.name }}/packer-debian9-{{ item.size }}G-{{ item.name }}
args
:
creates
:
output-debian9-{{ item.size }}G-{{ item.name }}/packer-debian9-{{ item.size }}G-{{ item.name }}.gz
with_items
:
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
}
ignore_errors
:
True
-
shell
:
gzip output-ubuntu-14-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-14-server-{{ item.size }}G-{{ item.name }}
-
shell
:
gzip output-ubuntu-14-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-14-server-{{ item.size }}G-{{ item.name }}
args
:
args
:
creates
:
output-ubuntu-14-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-14-server-{{ item.size }}G-{{ item.name }}.gz
creates
:
output-ubuntu-14-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-14-server-{{ item.size }}G-{{ item.name }}.gz
...
@@ -151,6 +168,9 @@
...
@@ -151,6 +168,9 @@
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
debian9"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
debian9"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
debian9"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
centos7.2"
}
...
@@ -187,6 +207,9 @@
...
@@ -187,6 +207,9 @@
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
debian7"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
debian9"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
debian9"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
debian9"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
200"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
50"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
centos7.2"
}
-
{
name
:
"
vm-bootstrap"
,
size
:
"
25"
,
distro
:
"
centos7.2"
}
...
...
packer/debian9.json
0 → 100644
View file @
fdebd6b1
{
"variables"
:
{
"user"
:
"slapos"
,
"password"
:
"slapos"
,
"domain"
:
""
,
"disk_size"
:
"100"
,
"name"
:
"image"
,
"custom_script"
:
"scripts/empty.sh"
},
"builders"
:
[
{
"name"
:
"debian9-{{ user `disk_size`}}G-{{ user `name`}}"
,
"type"
:
"qemu"
,
"format"
:
"qcow2"
,
"accelerator"
:
"kvm"
,
"disk_size"
:
"{{ user `disk_size`}}000"
,
"iso_url"
:
"http://cdimage.debian.org/debian-cd/9.2.1/amd64/iso-cd/debian-9.2.1-amd64-netinst.iso"
,
"iso_checksum"
:
"5c583fd40360fd039b3ac98387b77dbb"
,
"iso_checksum_type"
:
"md5"
,
"http_directory"
:
"http"
,
"ssh_username"
:
"{{user `user`}}"
,
"ssh_password"
:
"{{user `password`}}"
,
"ssh_wait_timeout"
:
"1800s"
,
"shutdown_command"
:
"echo '{{user `password`}}'|sudo -S shutdown -h now"
,
"headless"
:
true
,
"boot_wait"
:
"2s"
,
"boot_command"
:
[
"<esc><wait><wait>"
,
"install auto "
,
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-debian9.cfg "
,
"debian-installer=en_US locale=en_US keymap=fr "
,
"netcfg/get_hostname={{ .Name }} "
,
"netcfg/get_domain={{ user `domain`}} "
,
"fb=false debconf/frontend=noninteractive "
,
"passwd/user-fullname={{user `user`}} "
,
"passwd/user-password={{user `password`}} "
,
"passwd/user-password-again={{user `password`}} "
,
"passwd/username={{user `user`}} "
,
"<enter>"
]
}
],
"provisioners"
:
[
{
"type"
:
"shell"
,
"execute_command"
:
"echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
,
"scripts"
:
[
"scripts/update.sh"
,
"scripts/packages.sh"
,
"scripts/network-debian9.sh"
,
"scripts/cleanup.sh"
,
"{{ user `custom_script` }}"
]
}
]
}
packer/http/preseed-debian9.cfg
0 → 100644
View file @
fdebd6b1
d-i preseed/include string ../preseed-debian8.cfg
choose-mirror-bin mirror/http/proxy string
d-i apt-setup/use_mirror boolean true
d-i pkgsel/include string sudo aptitude openssh-server wget vim
apt-cdrom-setup apt-setup/cdrom/set-first boolean false
apt-mirror-setup apt-setup/use_mirror boolean true
popularity-contest popularity-contest/participate boolean false
tasksel tasksel/first multiselect standard, ssh-server
packer/scripts/network-debian9.sh
0 → 100755
View file @
fdebd6b1
#!/bin/sh
# provide ifconfig command
apt-get
install
-y
net-tools
# change default interface name to eth0 schema
sed
-i
's#GRUB_CMDLINE_LINUX=.*#GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"#'
/etc/default/grub
update-grub
sed
-i
's#allow-hotplug ens3.*#allow-hotplug eth0#'
/etc/network/interfaces
sed
-i
's#iface ens3 inet dhcp.*#iface eth0 inet dhcp#'
/etc/network/interfaces
packer/scripts/update.sh
View file @
fdebd6b1
# If aptitude is not present
apt-get
install
-y
aptitude
# Update the box
# Update the box
aptitude
-y
update
aptitude
-y
update
aptitude
-y
full-upgrade
aptitude
-y
full-upgrade
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment