As requested per #39595 as a feature request here in the forum:
The problem
Apparently there is no !secret
expansion in shell_commands, would be nice if this could be implemented. This saves me putting sensitive data into configuration files.
2020-09-02 22:41:16 DEBUG (MainThread) [homeassistant.components.shell_command] Stderr of command: `ssh -F /config/.ssh/config -o UserKnownHostsFile=/config/.ssh/known_hosts !secret ip_of_server1 sudo /usr/sbin/poweroff`, return code: 255:
b'ssh: Could not resolve hostname !secret: Try again\r\n'
Problem-relevant configuration.yaml
shell_command:
# TODO: move sensitive data to secrets
turn_off_server1: ssh -F /config/.ssh/config -o UserKnownHostsFile=/config/.ssh/known_hosts !secret ip_of_server1 sudo /usr/sbin/poweroff