1

Anyone know of a way to interact with the console/terminal over a salt-ssh command? I'm trying to run vim to change the subnet and FQDN for about 70 hosts. I could use sed and company but wondering if we can leverage salt-ssh for this task. Below, salt runs the command, but I can't interact with vim.

# salt-ssh '*' cmd.run 'vi /etc/hosts'
s^C
Exiting gracefully on Ctrl-c

Exiting gracefully on Ctrl-c

Exiting gracefully on Ctrl-c
Server Fault
  • 3,454
  • 7
  • 48
  • 88
  • it doesn't seem that salt-ssh expect to open an interactive shell with the minion, but running the command under an ssh connection. I don't have a working salt infrastructure right now, but you may try to run it with -t (or tty=true in roster conf) and execute `bash` to see if it spawns a shell instance. Yet I'm sceptical on if it works. – ignivs Dec 19 '17 at 14:50
  • No luck with`tty:true` or `salt-ssh -t` . That gives me something to dig into however, thanks. – Server Fault Dec 19 '17 at 15:16

0 Answers0