how to add a new machine

Note: this has recently been changed to rely more on puppet. If stuff breaks fix it.

    apt-get install --no-install-recommends ssh vim &&
    echo -n > /etc/environment &&
    echo -n > /etc/default/locale &&
    apt-get install --no-install-recommends dialog &&
    echo "debconf debconf/priority        select high" | debconf-set-selections &&
    echo "debconf debconf/frontend        select Dialog" | debconf-set-selections
    dpkg -l postfix | grep '^ii  postfix' && (dpkg --purge postfix && rm /etc/aliases)
    : :: draghi :: && sudo -u sshdist ud-generate && sudo -H ud-replicate && sudo -H puppetd --no-daemonize --onetime
    : :: denis :: && sudo -H ud-replicate
    apt-get update &&
    apt-get install -y --no-install-recommends userdir-ldap &&
    ud-replicate &&
    id weasel
    apt-get install -y debian.org debian.org-recommended
    puppet agent --no-daemonize --onetime; puppet agent --no-daemonize --onetime; puppet agent --no-daemonize --onetime; puppet agent --no-daemonize --onetime
    apt-get update && apt-get dist-upgrade && apt-get clean
    echo "ca-certificates ca-certificates/trust_new_crts  select no" | debconf-set-selections
    dpkg-reconfigure ca-certificates
  if ! egrep '^root:' /etc/aliases > /dev/null; then
    echo "root: debian-admin@debian.org" >> /etc/aliases
  elif ! egrep '^root:.*debian-admin@debian.org' /etc/aliases > /dev/null; then
    sed -i -e 's/^root: .*/&, debian-admin@debian.org/' /etc/aliases
  fi
  newaliases
  apt-get install -y samhain &&
  ( puppet agent --no-daemonize --onetime || true ) &&
  service samhain stop &&
  rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
  samhain --foreground -t init -p none -s none -l none -m none &&
  service samhain start

– weasel, Wed, 04 Jun 2008 20:52:56 +0200