Compare commits
38 Commits
v0.7.0-rc2
...
v0.7.2-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19fc67b49b | ||
|
|
d9605c5302 | ||
|
|
3ac0c42ffe | ||
|
|
9755a37fe6 | ||
|
|
e3df9911bc | ||
|
|
0c32665255 | ||
|
|
6f9bab57e3 | ||
|
|
e608377088 | ||
|
|
200052dd56 | ||
|
|
0107f361bb | ||
|
|
ea86e4e087 | ||
|
|
a90d93691f | ||
|
|
ddbedb9b31 | ||
|
|
94fd38c358 | ||
|
|
fb6442f9bb | ||
|
|
e8ffaedb08 | ||
|
|
d4fbc039a7 | ||
|
|
9654e4eaad | ||
|
|
2217e88611 | ||
|
|
4dd735bad4 | ||
|
|
4eaf18946a | ||
|
|
b6c103373e | ||
|
|
edd9d33eaa | ||
|
|
3e3e036bda | ||
|
|
f5681217b5 | ||
|
|
01970f5651 | ||
|
|
76b360706f | ||
|
|
dfc9455e72 | ||
|
|
c681c71fa6 | ||
|
|
805e865bfb | ||
|
|
e89f4f27e0 | ||
|
|
8b9edc2836 | ||
|
|
897cbb9e9f | ||
|
|
e97ad03b99 | ||
|
|
6ace0c1b05 | ||
|
|
cc538ad523 | ||
|
|
cdd3dcc99e | ||
|
|
4b121ec3b1 |
@@ -53,7 +53,7 @@ ARG DOCKER_BUILD_VERSION=1.10.3
|
||||
ARG DOCKER_BUILD_PATCH_VERSION=v${DOCKER_BUILD_VERSION}-ros1
|
||||
ARG SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.3/policy.29
|
||||
|
||||
ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/Ubuntu-4.4.0-37.56-rancher1/linux-4.4.19-rancher-x86.tar.gz
|
||||
ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/Ubuntu-4.4.0-47.68-rancher1/linux-4.4.24-rancher-x86.tar.gz
|
||||
ARG KERNEL_URL_arm64=https://github.com/imikushin/os-kernel/releases/download/Estuary-4.4.0-arm64.8/linux-4.4.0-rancher-arm64.tar.gz
|
||||
|
||||
ARG DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz
|
||||
|
||||
12
Makefile
12
Makefile
@@ -18,15 +18,15 @@ trash-keep: .dapper
|
||||
|
||||
deps: trash
|
||||
|
||||
build/initrd/.id:
|
||||
dapper prepare
|
||||
build/initrd/.id: .dapper
|
||||
./.dapper prepare
|
||||
|
||||
run: build/initrd/.id
|
||||
dapper -m bind build-target
|
||||
run: build/initrd/.id .dapper
|
||||
./.dapper -m bind build-target
|
||||
./scripts/run
|
||||
|
||||
shell-bind:
|
||||
dapper -m bind -s
|
||||
shell-bind: .dapper
|
||||
./.dapper -m bind -s
|
||||
|
||||
clean:
|
||||
@./scripts/clean
|
||||
|
||||
30
README.md
30
README.md
@@ -14,12 +14,12 @@ it would really be bad if somebody did `docker rm -f $(docker ps -qa)` and delet
|
||||
|
||||
## Latest Release
|
||||
|
||||
**v0.6.1 - Docker 1.12.1 - Linux 4.4.19**
|
||||
**v0.7.1 - Docker 1.12.3 - Linux 4.4.24**
|
||||
|
||||
### ISO
|
||||
|
||||
https://releases.rancher.com/os/latest/rancheros.iso
|
||||
https://releases.rancher.com/os/v0.6.1/rancheros.iso
|
||||
https://releases.rancher.com/os/v0.7.1/rancheros.iso
|
||||
|
||||
### Additional Downloads
|
||||
|
||||
@@ -29,25 +29,25 @@ https://releases.rancher.com/os/v0.6.1/rancheros.iso
|
||||
* https://releases.rancher.com/os/latest/iso-checksums.txt
|
||||
* https://releases.rancher.com/os/latest/rancheros-openstack.img
|
||||
* https://releases.rancher.com/os/latest/rancheros-raspberry-pi.zip
|
||||
* https://releases.rancher.com/os/latest/rancheros-v0.6.1.tar.gz
|
||||
* https://releases.rancher.com/os/latest/rancheros-v0.7.1.tar.gz
|
||||
* https://releases.rancher.com/os/latest/rancheros.iso
|
||||
* https://releases.rancher.com/os/latest/rootfs_arm.tar.gz
|
||||
* https://releases.rancher.com/os/latest/rootfs_arm64.tar.gz
|
||||
* https://releases.rancher.com/os/latest/rootfs.tar.gz
|
||||
* https://releases.rancher.com/os/latest/vmlinuz
|
||||
|
||||
#### v0.6.1
|
||||
#### v0.7.1
|
||||
|
||||
* https://releases.rancher.com/os/v0.6.1/initrd
|
||||
* https://releases.rancher.com/os/v0.6.1/iso-checksums.txt
|
||||
* https://releases.rancher.com/os/v0.6.1/rancheros-openstack.img
|
||||
* https://releases.rancher.com/os/v0.6.1/rancheros-raspberry-pi.zip
|
||||
* https://releases.rancher.com/os/v0.6.1/rancheros-v0.6.1.tar.gz
|
||||
* https://releases.rancher.com/os/v0.6.1/rancheros.iso
|
||||
* https://releases.rancher.com/os/v0.6.1/rootfs_arm.tar.gz
|
||||
* https://releases.rancher.com/os/v0.6.1/rootfs_arm64.tar.gz
|
||||
* https://releases.rancher.com/os/v0.6.1/rootfs.tar.gz
|
||||
* https://releases.rancher.com/os/v0.6.1/vmlinuz
|
||||
* https://releases.rancher.com/os/v0.7.1/initrd
|
||||
* https://releases.rancher.com/os/v0.7.1/iso-checksums.txt
|
||||
* https://releases.rancher.com/os/v0.7.1/rancheros-openstack.img
|
||||
* https://releases.rancher.com/os/v0.7.1/rancheros-raspberry-pi.zip
|
||||
* https://releases.rancher.com/os/v0.7.1/rancheros-v0.7.1.tar.gz
|
||||
* https://releases.rancher.com/os/v0.7.1/rancheros.iso
|
||||
* https://releases.rancher.com/os/v0.7.1/rootfs_arm.tar.gz
|
||||
* https://releases.rancher.com/os/v0.7.1/rootfs_arm64.tar.gz
|
||||
* https://releases.rancher.com/os/v0.7.1/rootfs.tar.gz
|
||||
* https://releases.rancher.com/os/v0.7.1/vmlinuz
|
||||
|
||||
**Note**: you can use `http` instead of `https` in the above URLs, e.g. for iPXE.
|
||||
|
||||
@@ -74,7 +74,7 @@ us-west-2 | HVM | [ami-1ed3007e](https://console.aws.amazon.com/ec2/home?region
|
||||
|
||||
We are providing a disk image that users can download and import for use in Google Compute Engine. The image can be obtained from the release artifacts for RancherOS.
|
||||
|
||||
[Download Image](https://github.com/rancher/os/releases/download/v0.6.1/rancheros-v0.6.1.tar.gz)
|
||||
[Download Image](https://github.com/rancher/os/releases/download/v0.7.1/rancheros-v0.7.1.tar.gz)
|
||||
|
||||
Please follow the directions at our [docs to launch in GCE](http://docs.rancher.com/os/running-rancheros/cloud/gce/).
|
||||
|
||||
|
||||
@@ -51,15 +51,17 @@ func Main() {
|
||||
}
|
||||
|
||||
password := config.GetCmdline("rancher.password")
|
||||
cmd := exec.Command("chpasswd")
|
||||
cmd.Stdin = strings.NewReader(fmt.Sprint("rancher:", password))
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
if password != "" {
|
||||
cmd := exec.Command("chpasswd")
|
||||
cmd.Stdin = strings.NewReader(fmt.Sprint("rancher:", password))
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
cmd = exec.Command("bash", "-c", `sed -E -i 's/(rancher:.*:).*(:.*:.*:.*:.*:.*:.*)$/\1\2/' /etc/shadow`)
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
cmd = exec.Command("bash", "-c", `sed -E -i 's/(rancher:.*:).*(:.*:.*:.*:.*:.*:.*)$/\1\2/' /etc/shadow`)
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := setupSSH(cfg); err != nil {
|
||||
@@ -93,7 +95,7 @@ func Main() {
|
||||
}
|
||||
}
|
||||
|
||||
cmd = exec.Command("bash", "-c", `echo 'RancherOS \n \l' > /etc/issue`)
|
||||
cmd := exec.Command("bash", "-c", `echo 'RancherOS \n \l' > /etc/issue`)
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
@@ -111,6 +113,11 @@ func Main() {
|
||||
if err := runScript(startScript); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(consoleDone, []byte(cfg.Rancher.Console), 0644); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
if err := runScript("/etc/rc.local"); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
@@ -122,10 +129,6 @@ func Main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(consoleDone, []byte(cfg.Rancher.Console), 0644); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
log.Fatal(syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ()))
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ rancher:
|
||||
hostname: {{.HOSTNAME_DEFAULT}}
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
docker:
|
||||
engine: docker-1.12.1
|
||||
engine: docker-1.12.3
|
||||
{{else -}}
|
||||
docker:
|
||||
engine: docker-1.11.2
|
||||
@@ -145,8 +145,10 @@ rancher:
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
volumes:
|
||||
- /usr/bin/ros:/usr/bin/ros
|
||||
- /usr/bin/ros:/usr/bin/cloud-init-execute
|
||||
cloud-init-pre:
|
||||
image: {{.OS_REPO}}/os-cloudinit:{{.VERSION}}{{.SUFFIX}}
|
||||
environment:
|
||||
@@ -371,7 +373,7 @@ rancher:
|
||||
- /opt:/opt
|
||||
docker:
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
image: {{.OS_REPO}}/os-docker:1.12.1{{.SUFFIX}}
|
||||
image: {{.OS_REPO}}/os-docker:1.12.3{{.SUFFIX}}
|
||||
{{else -}}
|
||||
image: {{.OS_REPO}}/os-docker:1.11.2{{.SUFFIX}}
|
||||
{{end -}}
|
||||
@@ -413,7 +415,7 @@ rancher:
|
||||
image: {{.OS_REPO}}/os
|
||||
docker:
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
engine: docker-1.12.1
|
||||
engine: docker-1.12.3
|
||||
{{else -}}
|
||||
engine: docker-1.11.2
|
||||
{{end -}}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# Packet Support
|
||||
|
||||
Launch a Type-0, Type-1 or Type-3 Ubuntu 14.04 server and use the below cloud config. You can add any additional RancherOS configuration to it, but below is the bare minimum you need to provision RancherOS.
|
||||
|
||||
```yaml
|
||||
#cloud-config
|
||||
runcmd:
|
||||
- wget -O /tmp/cc https://raw.githubusercontent.com/rancher/os/master/scripts/hosting/packet/packet.sh
|
||||
- bash -x /tmp/cc
|
||||
```
|
||||
@@ -1,4 +0,0 @@
|
||||
#cloud-config
|
||||
runcmd:
|
||||
- wget -O /tmp/cc https://raw.githubusercontent.com/rancher/os/master/scripts/hosting/packet/packet.sh
|
||||
- bash -x /tmp/cc
|
||||
@@ -1,96 +1,124 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if ros version >/dev/null 2>&1; then
|
||||
exit 0
|
||||
TINKERBELL_URL=$(cat /proc/cmdline | sed -e 's/^.*tinkerbell=//' -e 's/ .*$//')/phone-home
|
||||
INSTALLER_IMAGE=rancher/os:v0.7.0-rc3
|
||||
|
||||
tinkerbell_post()
|
||||
{
|
||||
system-docker run rancher/curl -X POST -H "Content-Type: application/json" -d "{\"type\":\"provisioning.$1\",\"body\":\"$2\"}" ${TINKERBELL_URL}
|
||||
}
|
||||
|
||||
tinkerbell_post 104 "Connected to magic install system"
|
||||
|
||||
DEV_PREFIX=/dev/sd
|
||||
if [ -e /dev/vda ]; then
|
||||
DEV_PREFIX=/dev/vd
|
||||
fi
|
||||
|
||||
apt-get install -y jq curl
|
||||
BOOT=${DEV_PREFIX}a1
|
||||
BOOT_TYPE=83
|
||||
SWAP=${DEV_PREFIX}a5
|
||||
SWAP_TYPE=82
|
||||
OEM=${DEV_PREFIX}a6
|
||||
OEM_TYPE=83
|
||||
ROOT=${DEV_PREFIX}a7
|
||||
ROOT_TYPE=83
|
||||
RAID=false
|
||||
|
||||
mkdir -p /boot/ros
|
||||
|
||||
URL_BASE=https://releases.rancher.com/os/latest
|
||||
curl -L $URL_BASE/vmlinuz > /boot/ros/vmlinuz
|
||||
curl -L $URL_BASE/initrd > /boot/ros/initrd
|
||||
|
||||
eval $(curl -sL https://metadata.packet.net/metadata | jq -r '.network.addresses[] | select(.address_family == 4 and .public) | "ADDRESS=\(.address)/\(.cidr)\nGATEWAY=\(.gateway)"')
|
||||
eval $(curl -sL https://metadata.packet.net/metadata | jq -r '.network.interfaces[0] | "MAC=\(.mac)"')
|
||||
|
||||
cat > /etc/default/grub << "EOF"
|
||||
# If you change this file, run 'update-grub' afterwards to update
|
||||
# /boot/grub/grub.cfg.
|
||||
# For full documentation of the options in this file, see:
|
||||
# info -f grub -n 'Simple configuration'
|
||||
|
||||
GRUB_DEFAULT=ROS
|
||||
GRUB_HIDDEN_TIMEOUT=15
|
||||
GRUB_HIDDEN_TIMEOUT_QUIET=false
|
||||
GRUB_TIMEOUT=10
|
||||
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
|
||||
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS1,115200n8"
|
||||
GRUB_CMDLINE_LINUX=""
|
||||
|
||||
# Uncomment to enable BadRAM filtering, modify to suit your needs
|
||||
# This works with Linux (no patch required) and with any kernel that obtains
|
||||
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
|
||||
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
|
||||
|
||||
# Uncomment to disable graphical terminal (grub-pc only)
|
||||
GRUB_TERMINAL=console
|
||||
|
||||
# The resolution used on graphical terminal
|
||||
# note that you can use only modes which your graphic card supports via VBE
|
||||
# you can see them in real GRUB with the command `vbeinfo'
|
||||
#GRUB_GFXMODE=640x480
|
||||
|
||||
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
|
||||
#GRUB_DISABLE_LINUX_UUID=true
|
||||
|
||||
# Uncomment to disable generation of recovery mode menu entries
|
||||
#GRUB_DISABLE_RECOVERY="true"
|
||||
|
||||
# Uncomment to get a beep at grub start
|
||||
#GRUB_INIT_TUNE="480 440 1"
|
||||
GRUB_TERMINAL=serial
|
||||
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=1 --word=8 --parity=no --stop=1"
|
||||
EOF
|
||||
|
||||
cat > /etc/grub.d/50ros << EOF
|
||||
#!/bin/sh
|
||||
exec tail -n +3 \$0
|
||||
# This file provides an easy way to add custom menu entries. Simply type the
|
||||
# menu entries you want to add after this comment. Be careful not to change
|
||||
# the 'exec tail' line above.
|
||||
menuentry 'ROS' {
|
||||
recordfail
|
||||
load_video
|
||||
insmod gzio
|
||||
insmod part_msdos
|
||||
insmod part_msdos
|
||||
insmod diskfilter
|
||||
insmod mdraid1x
|
||||
insmod ext2
|
||||
linux /ros/vmlinuz rancher.state.mdadm_scan rancher.state.directory=ros rancher.network.interfaces.bond0.address=$ADDRESS rancher.network.interfaces.bond0.gateway=$GATEWAY rancher.network.interfaces.mac:${MAC}.bond=bond0 rancher.cloud_init.datasources=[packet] rancher.rm_usr console=tty0 console=ttyS1,115200n8
|
||||
initrd /ros/initrd
|
||||
}
|
||||
menuentry 'ROS Debug' {
|
||||
recordfail
|
||||
load_video
|
||||
insmod gzio
|
||||
insmod part_msdos
|
||||
insmod part_msdos
|
||||
insmod diskfilter
|
||||
insmod mdraid1x
|
||||
insmod ext2
|
||||
linux /ros/vmlinuz rancher.state.mdadm_scan rancher.state.directory=ros rancher.network.interfaces.bond0.address=$ADDRESS rancher.network.interfaces.bond0.gateway=$GATEWAY rancher.network.interfaces.mac:${MAC}.bond=bond0 rancher.cloud_init.datasources=[packet] rancher.rm_usr rancher.network.interfaces.eth*.dhcp=false console=tty0 console=ttyS1,115200n8 rancher.debug rancher.log
|
||||
initrd /ros/initrd
|
||||
wait_for_dev()
|
||||
{
|
||||
for DEV; do
|
||||
for ((i=0;i<10;i++)); do
|
||||
if [ ! -e $DEV ]; then
|
||||
partprobe || true
|
||||
sleep 1
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
modprobe md || true
|
||||
|
||||
dd if=/dev/zero of=${DEV_PREFIX}a bs=1M count=1
|
||||
|
||||
if [ -e ${DEV_PREFIX}b ]; then
|
||||
dd if=/dev/zero of=${DEV_PREFIX}b bs=1M count=1
|
||||
RAID=true
|
||||
BOOT=/dev/md1
|
||||
BOOT_TYPE=fd
|
||||
SWAP=/dev/md5
|
||||
SWAP_TYPE=fd
|
||||
OEM=/dev/md6
|
||||
OEM_TYPE=fd
|
||||
ROOT=/dev/md7
|
||||
ROOT_TYPE=fd
|
||||
fi
|
||||
|
||||
|
||||
# Partition BOOT
|
||||
echo -e "n\np\n1\n\n+2G\nt\n${BOOT_TYPE}\nw" | fdisk ${DEV_PREFIX}a || true
|
||||
partprobe || true
|
||||
# Partition Extended
|
||||
echo -e "n\ne\n\n\n\nw" | fdisk ${DEV_PREFIX}a || true
|
||||
partprobe || true
|
||||
# Partition SWAP
|
||||
echo -e "n\nl\n\n+2G\n\nt\n5\n${SWAP_TYPE}\nw" | fdisk ${DEV_PREFIX}a || true
|
||||
partprobe || true
|
||||
# Partition OEM
|
||||
echo -e "n\nl\n\n+100M\n\nt\n6\n${OEM_TYPE}\nw" | fdisk ${DEV_PREFIX}a || true
|
||||
partprobe || true
|
||||
# Partition ROOT
|
||||
echo -e "n\nl\n\n\n\nt\n7\n${ROOT_TYPE}\nw" | fdisk ${DEV_PREFIX}a || true
|
||||
partprobe || true
|
||||
# Make boot active
|
||||
echo -e "a\n1\nw" | fdisk ${DEV_PREFIX}a || true
|
||||
partprobe || true
|
||||
|
||||
if [ "$RAID" = "true" ]; then
|
||||
sfdisk --dump ${DEV_PREFIX}a | sfdisk --no-reread ${DEV_PREFIX}b
|
||||
|
||||
wait_for_dev ${DEV_PREFIX}b1 ${DEV_PREFIX}b5 ${DEV_PREFIX}b6 ${DEV_PREFIX}b7 ${DEV_PREFIX}a1 ${DEV_PREFIX}a5 ${DEV_PREFIX}a6 ${DEV_PREFIX}a7
|
||||
|
||||
mdadm --create $BOOT --level=1 --metadata=1.0 --raid-devices=2 ${DEV_PREFIX}a1 ${DEV_PREFIX}b1
|
||||
mdadm --create $SWAP --level=1 --metadata=1.2 --raid-devices=2 ${DEV_PREFIX}a5 ${DEV_PREFIX}b5
|
||||
mdadm --create $OEM --level=1 --metadata=1.2 --raid-devices=2 ${DEV_PREFIX}a6 ${DEV_PREFIX}b6
|
||||
mdadm --create $ROOT --level=1 --metadata=1.2 --raid-devices=2 ${DEV_PREFIX}a7 ${DEV_PREFIX}b7
|
||||
fi
|
||||
|
||||
mkswap -L RANCHER_SWAP $SWAP
|
||||
system-docker run --privileged --entrypoint /bin/bash ${INSTALLER_IMAGE} -c "mkfs.ext4 -L RANCHER_BOOT $BOOT"
|
||||
system-docker run --privileged --entrypoint /bin/bash ${INSTALLER_IMAGE} -c "mkfs.ext4 -L RANCHER_STATE $ROOT"
|
||||
system-docker run --privileged --entrypoint /bin/bash ${INSTALLER_IMAGE} -c "mkfs.ext4 -L RANCHER_OEM $OEM"
|
||||
|
||||
tinkerbell_post 105 "Server partitions created"
|
||||
|
||||
mkdir -p /mnt/oem
|
||||
mount $(ros dev LABEL=RANCHER_OEM) /mnt/oem
|
||||
cat > /mnt/oem/oem-config.yml << EOF
|
||||
#cloud-config
|
||||
mounts:
|
||||
- [ LABEL=RANCHER_SWAP, "", swap, "" ]
|
||||
EOF
|
||||
umount /mnt/oem
|
||||
|
||||
chmod +x /etc/grub.d/50ros
|
||||
tinkerbell_post 106 "OEM drive configured"
|
||||
|
||||
update-grub2
|
||||
METADATA=$(system-docker run rancher/curl -sL https://metadata.packet.net/metadata)
|
||||
eval $(echo ${METADATA} | jq -r '.network.addresses[] | select(.address_family == 4 and .public) | "ADDRESS=\(.address)/\(.cidr)\nGATEWAY=\(.gateway)"')
|
||||
eval $(echo ${METADATA} | jq -r '.network.interfaces[0] | "MAC=\(.mac)"')
|
||||
NETWORK_ARGS="rancher.network.interfaces.bond0.address=$ADDRESS rancher.network.interfaces.bond0.gateway=$GATEWAY rancher.network.interfaces.mac:${MAC}.bond=bond0"
|
||||
|
||||
tune2fs -L RANCHER_STATE $(df -h / | sed 1d | awk '{print $1}')
|
||||
tinkerbell_post 107 "Network interface configuration fetched from metadata"
|
||||
|
||||
COMMON_ARGS="console=ttyS1,115200n8 rancher.autologin=ttyS1 rancher.cloud_init.datasources=[packet] ${NETWORK_ARGS}"
|
||||
if [ "$RAID" = "true" ]; then
|
||||
ros install -f -t raid -i ${INSTALLER_IMAGE} -d ${DEV_PREFIX}a -a "rancher.state.mdadm_scan ${COMMON_ARGS}" --no-reboot
|
||||
else
|
||||
ros install -f -t noformat -i ${INSTALLER_IMAGE} -d ${DEV_PREFIX}a -a "${COMMON_ARGS}" --no-reboot
|
||||
fi
|
||||
|
||||
tinkerbell_post 108 "Installation finished, rebooting server"
|
||||
reboot
|
||||
|
||||
@@ -15,13 +15,14 @@ write_files:
|
||||
permissions: "0755"
|
||||
owner: root
|
||||
content: |
|
||||
touch /home/rancher/test4
|
||||
wait-for-docker
|
||||
docker run -d nginx
|
||||
- path: /var/lib/rancher/conf/cloud-config-script
|
||||
permissions: "0755"
|
||||
owner: root
|
||||
content: |
|
||||
#!/bin/bash
|
||||
touch /home/rancher/test5
|
||||
touch /home/rancher/test4
|
||||
runcmd:
|
||||
- []
|
||||
- [ test ]
|
||||
|
||||
15
tests/bad_state_test.go
Normal file
15
tests/bad_state_test.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package integration
|
||||
|
||||
import . "gopkg.in/check.v1"
|
||||
|
||||
func (s *QemuSuite) TestBadState(c *C) {
|
||||
err := s.RunQemu("--no-format", "--append", "rancher.state.dev=LABEL=BAD_STATE")
|
||||
c.Assert(err, IsNil)
|
||||
s.CheckCall(c, "mount | grep /var/lib/docker | grep rootfs")
|
||||
}
|
||||
|
||||
func (s *QemuSuite) TestBadStateWithWait(c *C) {
|
||||
err := s.RunQemu("--no-format", "--append", "rancher.state.dev=LABEL=BAD_STATE", "--append", "rancher.state.wait")
|
||||
c.Assert(err, IsNil)
|
||||
s.CheckCall(c, "mount | grep /var/lib/docker | grep rootfs")
|
||||
}
|
||||
@@ -10,7 +10,8 @@ func (s *QemuSuite) TestStartCommands(c *C) {
|
||||
err := s.RunQemu("--cloud-config", "./tests/assets/test_26/cloud-config.yml")
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
for i := 1; i < 6; i++ {
|
||||
for i := 1; i < 5; i++ {
|
||||
s.CheckCall(c, fmt.Sprintf("ls /home/rancher | grep test%d", i))
|
||||
}
|
||||
s.CheckCall(c, "docker ps | grep nginx")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user