
Estoy usando Packer para actualizar una imagen de RStudio que mantengo (https://marketplace.digitalocean.com/apps/rstudio), esto es algo que hago por la comunidad. El primer script en proceso comienza con este código:
#!/bin/bash
# non-interactive install
DEBIAN_FRONTEND=noninteractive
# Add a swap file to prevent build time OOM errors
fallocate -l 8G /swapfile
mkswap /swapfile
swapon /swapfile
# add CRAN to apt sources
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
printf '\n#CRAN mirror\ndeb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/\n' | tee -a /etc/apt/sources.list
# update apt
apt-get -qqy -o Dpkg::Options::=--force-confdef update
apt-get -qqy -o Dpkg::Options::=--force-confdef upgrade
Sin embargo, cuando ejecuto packer build conf.json
el proceso, falla porque el servidor openssh ignora la configuración no interactiva y el script se detiene aquí:
digitalocean: A new version (/tmp/fileVGUVsU) of configuration file /etc/ssh/sshd_config is
digitalocean: available, but the version installed currently has been locally modified.
digitalocean:
digitalocean: 1. install the package maintainer's version
digitalocean: 2. keep the local version currently installed
digitalocean: 3. show the differences between the versions
digitalocean: 4. show a side-by-side difference between the versions
digitalocean: 5. show a 3-way difference between available versions
digitalocean: 6. do a 3-way merge between available versions
digitalocean: 7. start a new shell to examine the situation
¿Cómo puedo seleccionar siempre la primera opción? He leído todas las publicaciones relacionadas que pude encontrar.