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
Francois Le Corre
slapos.package
Commits
a4d03a18
Commit
a4d03a18
authored
Aug 01, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: Add packer config to generate a ready to use disk image
parent
269b8f0d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
0 deletions
+99
-0
packer/debian9-rs-base.json
packer/debian9-rs-base.json
+73
-0
packer/scripts/setup-base-slapos.sh
packer/scripts/setup-base-slapos.sh
+26
-0
No files found.
packer/debian9-rs-base.json
0 → 100644
View file @
a4d03a18
{
"variables"
:
{
"user"
:
"slapos"
,
"password"
:
"slapos"
,
"domain"
:
""
,
"disk_size"
:
"6"
,
"name"
:
"image"
,
"custom_script"
:
"scripts/empty.sh"
,
"re6st_token"
:
"{{env `RE6STTOKEN`}}"
,
"computer_token"
:
"{{env `COMPUTERTOKEN`}}"
"computer_name"
:
"{{env `COMPUTERNAME`}}"
},
"builders"
:
[
{
"name"
:
"debian9-rs-base-{{ user `disk_size`}}G-{{ user `name`}}"
,
"type"
:
"qemu"
,
"format"
:
"raw"
,
"accelerator"
:
"kvm"
,
"disk_size"
:
"{{ user `disk_size`}}000"
,
"iso_url"
:
"https://cdimage.debian.org/mirror/cdimage/archive/9.9.0/amd64/iso-cd/debian-9.9.0-amd64-netinst.iso"
,
"iso_checksum"
:
"e494e78d531352f0f3fdb210f13f7577"
,
"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}}'"
,
"environment_vars"
:
[
"re6st_token={{ user `re6st_token` }}"
,
"computer_name={{user `computer_name`}}"
,
"computer_token={{ user `computer_token` }}"
],
"scripts"
:
[
"scripts/update.sh"
,
"scripts/packages.sh"
,
"scripts/network-debian9.sh"
,
"scripts/cleanup.sh"
,
"scripts/setup-base-slapos.sh"
,
"{{ user `custom_script` }}"
]
}
]
}
packer/scripts/setup-base-slapos.sh
0 → 100644
View file @
a4d03a18
#!/bin/bash
set
-e
aptitude
-y
install
--without-recommends
python-setuptools
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip2
install
--exists-action
=
i six
pip2
install
--exists-action
=
i requests
pip2
install
--exists-action
=
i slapcache
wget http://deploy.erp5.net/vifib-base
-O
/root/run-vifib-base
RE6STTOKEN
=
$re6st_token
COMPUTERTOKEN
=
$computer_token
COMPUTERNAME
=
$computer_name
bash /root/run-vifib-base
re6st-conf
--registry
http://re6stnet.gnet.erp5.cn/
--token
$RE6STTOKEN
-r
title
$RE6STTOKEN
-d
/etc/re6stnet
slapos node register
--token
$COMPUTERTOKEN
--interface-name
lo
$COMPUTERNAME
# Re-run after the register to finish up the configuration
bash /root/run-vifib-base
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