使用 salt-ssh 進行 Ubuntu/Debian 修補(對話方塊前端不可用)

使用 salt-ssh 進行 Ubuntu/Debian 修補(對話方塊前端不可用)

我正在考慮用salt-ssh.

目前系統使用 shell 腳本來遍歷主機清單並複製一個名為apt 更新到遙控器。複製腳本後,進程會在遠端(透過 ssh)執行該腳本。這apt 更新腳本基本上包含apt-get udpate; apt-get upgrade.當設定檔(例如 Grub)發生衝突或dpkg-reconfigure執行類似 的檔案時pam-auth-update,需要互動來選擇如何繼續。如果我運行此過程salt-ssh,似乎沒有機會與更新過程進行互動。事實上,salt-sshstdout 包含以下內容:

stderr:
  debconf: unable to initialize frontend: Dialog
  debconf: (TERM is not set, so the dialog frontend is not usable.)
  debconf: falling back to frontend: Readline
  debconf: unable to initialize frontend: Readline
  debconf: (This frontend requires a controlling tty.)
  debconf: falling back to frontend: Teletype
  dpkg-preconfigure: unable to re-open stdin:

我以前沒有使用過 Saltstack。當需要互動時,有沒有辦法處理這種情況?

答案1

您可以設定環境變數DEBIAN_FRONTEND=noninteractive以抑制所有此類問題。但是,在這種情況下如何配置套件可能會有所不同,因此您應該進行徹底的測試。

相關內容