Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace invocations to apt with DEBIAN_FRONTEND=noninteractive apt-get #74

Merged
merged 2 commits into from
Jun 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions http/stretch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ echo d-i finish-install/reboot_in_progress note
type .\http\packages.cfg>>.\http\stretch.cfg

(
echo d-i preseed/late_command string sed -i -e "s/.*PermitRootLogin.*/PermitRootLogin yes/g" /target/etc/ssh/sshd_config ; chroot /target /bin/bash -c 'service ssh stop ; apt-get install hyperv-daemons' ;
)>>.\http\stretch.cfg
echo d-i preseed/late_command string sed -i -e "s/.*PermitRootLogin.*/PermitRootLogin yes/g" /target/etc/ssh/sshd_config ; chroot /target /bin/bash -c 'service ssh stop ; DEBIAN_FRONTEND=noninteractive apt-get install hyperv-daemons' ;
)>>.\http\stretch.cfg
2 changes: 1 addition & 1 deletion provisioning/en/provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ else
echo "Installing $CMD ..."
echo >> /etc/apt/sources.list
echo "deb http://deb.subutai.io/subutai $ENV main" | tee --append /etc/apt/sources.list
apt update && apt -y install subutai
DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install subutai
cmd_path="$(which $CMD)"
fi

Expand Down
6 changes: 3 additions & 3 deletions scripts/apt.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

echo Updating from repositories ...
sudo apt-get -y update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y update

echo Upgrading distribution ...
sudo apt-get -y dist-upgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade

echo Adding needed packages ...
sudo apt-get -y install net-tools inotify-tools
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install net-tools inotify-tools



8 changes: 4 additions & 4 deletions scripts/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ if [ -z "$BRANCHTAG" ]; then
exit -1
fi

apt-get -y autoremove
DEBIAN_FRONTEND=noninteractive apt-get -y autoremove

# seems this is removing everything we install
#sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
#sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo DEBIAN_FRONTEND=noninteractive apt-get -y purge

echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*
Expand All @@ -20,7 +20,7 @@ fi

echo "Replacing /etc/apt/sources.list with standard sources"
cp /tmp/sources.list /etc/apt/sources.list
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get update

echo "Setting ulimit -n 65535 in /etc/profile"
sed -i '1 i\ulimit -n 65535' /etc/profile
sed -i '1 i\ulimit -n 65535' /etc/profile
2 changes: 1 addition & 1 deletion scripts/debian/vmware.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh -eux

# install open-vm-tools
apt-get install -y open-vm-tools;
DEBIAN_FRONTEND=noninteractive apt-get install -y open-vm-tools;

# set a default HOME_DIR environment variable if not set
HOME_DIR="${HOME_DIR:-/home/subutai}";
Expand Down
2 changes: 1 addition & 1 deletion scripts/ubuntu/vmware.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh -eux

apt-get install -y open-vm-tools;
DEBIAN_FRONTEND=noninteractive apt-get install -y open-vm-tools;
mkdir /mnt/hgfs;
echo "platform specific vmware.sh executed";
6 changes: 3 additions & 3 deletions scripts/ubuntu/zfs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

apt -y install zfsutils-linux
DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils-linux

/sbin/modprobe zfs

Expand All @@ -10,9 +10,9 @@ zfs create -o mountpoint="/var/lib/lxc" subutai/fs

zpool set autoexpand=on subutai

apt -y install lxc
DEBIAN_FRONTEND=noninteractive apt-get -y install lxc

apt-get -y install dirmngr
DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1

6 changes: 3 additions & 3 deletions scripts/vbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
echo "==> Installing VirtualBox guest additions"

# Assuming the following packages are installed
apt-get install -y linux-headers-$(uname -r) build-essential perl
apt-get install -y dkms
DEBIAN_FRONTEND=noninteractive apt-get install -y linux-headers-$(uname -r) build-essential perl
DEBIAN_FRONTEND=noninteractive apt-get install -y dkms

VBOX_VERSION=$(cat /home/${SSH_USERNAME}/.vbox_version)
mount -o loop /home/${SSH_USERNAME}/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
Expand All @@ -14,4 +14,4 @@ rm /home/${SSH_USERNAME}/.vbox_version

if [[ $VBOX_VERSION = "4.3.10" ]]; then
ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
fi
fi
6 changes: 3 additions & 3 deletions scripts/zfs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

apt -y install zfsutils
DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils

/sbin/modprobe zfs

Expand All @@ -10,9 +10,9 @@ zfs create -o mountpoint="/var/lib/lxc" subutai/fs

zpool set autoexpand=on subutai

apt -y install lxc
DEBIAN_FRONTEND=noninteractive apt-get -y install lxc

apt-get -y install dirmngr
DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1

16 changes: 8 additions & 8 deletions stretch/hyperv/provisioner.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
"echo 'subutai ALL=NOPASSWD: ALL' >> /etc/sudoers",
"date > /home/{{user `ssh_username`}}/vagrant_box_build_time",
"echo Updating from repositories ...",
"apt-get -y update",
"DEBIAN_FRONTEND=noninteractive apt-get -y update",
"echo Upgrading distribution ...",
"apt-get -y dist-upgrade",
"DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade",
"echo Adding needed packages ...",
"apt-get -y install net-tools inotify-tools",
"DEBIAN_FRONTEND=noninteractive apt-get -y install net-tools inotify-tools",
"echo \"{{user `ssh_username`}} ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers.d/{{user `ssh_username`}}",
"chmod 440 /etc/sudoers.d/{{user `ssh_username`}}",
"mkdir -pm 700 /home/{{user `ssh_username`}}/.ssh",
"wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/{{user `ssh_username`}}/.ssh/authorized_keys",
"chmod 0600 /home/{{user `ssh_username`}}/.ssh/authorized_keys",
"chown -R {{user `ssh_username`}}:{{user `ssh_username`}} /home/{{user `ssh_username`}}/.ssh",
"cp /tmp/sources.list /etc/apt/sources.list",
"apt-get update",
"DEBIAN_FRONTEND=noninteractive apt-get update",
"sed -i '1 i\\ulimit -n 65535' /etc/profile",
"apt -y install zfsutils",
"DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils",
"/sbin/modprobe zfs",
"zpool create -f subutai /dev/mapper/main-zfs",
"zfs create -o mountpoint=\"/var/lib/lxc\" subutai/fs",
"zpool set autoexpand=on subutai",
"apt -y install lxc",
"apt-get -y install dirmngr",
"DEBIAN_FRONTEND=noninteractive apt-get -y install lxc",
"DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr",
"apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1"
]
}
}
20 changes: 10 additions & 10 deletions xenial/hyperv/provisioner.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
"echo 'subutai ALL=NOPASSWD: ALL' >> /etc/sudoers",
"date > /home/{{user `ssh_username`}}/vagrant_box_build_time",
"echo Updating from repositories ...",
"apt-get -y update",
"DEBIAN_FRONTEND=noninteractive apt-get -y update",
"echo Upgrading distribution ...",
"apt-get -y dist-upgrade",
"DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade",
"echo Adding needed packages ...",
"apt-get -y install net-tools inotify-tools",
"apt-get -y install linux-cloud-tools-$(uname -r)",
"apt-get -y install linux-virtual-lts-xenial linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial",
"DEBIAN_FRONTEND=noninteractive apt-get -y install net-tools inotify-tools",
"DEBIAN_FRONTEND=noninteractive apt-get -y install linux-cloud-tools-$(uname -r)",
"DEBIAN_FRONTEND=noninteractive apt-get -y install linux-virtual-lts-xenial linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial",
"echo \"{{user `ssh_username`}} ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers.d/{{user `ssh_username`}}",
"chmod 440 /etc/sudoers.d/{{user `ssh_username`}}",
"mkdir -pm 700 /home/{{user `ssh_username`}}/.ssh",
"wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/{{user `ssh_username`}}/.ssh/authorized_keys",
"chmod 0600 /home/{{user `ssh_username`}}/.ssh/authorized_keys",
"chown -R {{user `ssh_username`}}:{{user `ssh_username`}} /home/{{user `ssh_username`}}/.ssh",
"cp /tmp/sources.list /etc/apt/sources.list",
"apt-get update",
"DEBIAN_FRONTEND=noninteractive apt-get update",
"sed -i '1 i\\ulimit -n 65535' /etc/profile",
"apt -y install zfsutils-linux",
"DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils-linux",
"/sbin/modprobe zfs",
"zpool create -f subutai /dev/mapper/main-zfs",
"zfs create -o mountpoint=\"/var/lib/lxc\" subutai/fs",
"zpool set autoexpand=on subutai",
"apt -y install lxc",
"apt-get -y install dirmngr",
"DEBIAN_FRONTEND=noninteractive apt-get -y install lxc",
"DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr",
"apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1"
]
}
}