infest centos7: yum install before rsync use

This commit is contained in:
lassulus 2015-03-28 22:31:37 +01:00 committed by tv
parent 501193f10b
commit a7d1ec58d0

18
infest
View File

@ -72,9 +72,23 @@ infest_centos7_64bit() {
export SSHPASS export SSHPASS
export RSYNC_RSH export RSYNC_RSH
main="$hostname.nix"
target="root@$address"
./networking-configuration $cac_servername $hostname \ ./networking-configuration $cac_servername $hostname \
> modules/networking-$hostname.nix > modules/networking-$hostname.nix
echo '(
set -xeuf
type bzip2 || yum install -y bzip2
type rsync || yum install -y rsync
)' \
| sshpass -e ssh \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
"root@$address" \
/bin/sh
rsync_filter "$main" \ rsync_filter "$main" \
| rsync -f '. -' -zvrlptD --delete-excluded ./ "$target":/etc/nixos/ | rsync -f '. -' -zvrlptD --delete-excluded ./ "$target":/etc/nixos/
@ -83,8 +97,6 @@ infest_centos7_64bit() {
# #
echo '( echo '(
set -xeuf set -xeuf
type bzip2 || yum install -y bzip2
type rsync || yum install -y rsync
groupadd -g 30000 nixbld || : groupadd -g 30000 nixbld || :
for i in `seq 1 10`; do for i in `seq 1 10`; do
useradd -c "foolsgarden Nix build user $i" \ useradd -c "foolsgarden Nix build user $i" \
@ -167,6 +179,7 @@ infest_centos7_64bit() {
mkdir -p /mnt/etc/nixos mkdir -p /mnt/etc/nixos
rsync -zvrlptD --delete-excluded /etc/nixos/ /mnt/etc/nixos/ rsync -zvrlptD --delete-excluded /etc/nixos/ /mnt/etc/nixos/
ln -s $main /mnt/etc/nixos/configuration.nix
nixos-install nixos-install
rsync -va --force /int/ / rsync -va --force /int/ /
@ -188,6 +201,7 @@ infest_centos7_64bit() {
nix_basename="$(basename $nix_url .tar.bz2)" \ nix_basename="$(basename $nix_url .tar.bz2)" \
nix_sha256="$nix_sha256" \ nix_sha256="$nix_sha256" \
nix_find_sha1sum="$nix_find_sha1sum" \ nix_find_sha1sum="$nix_find_sha1sum" \
main="$main" \
/bin/sh /bin/sh
} }