Hello,
I want to run a command remotely on another Linux machine via SSH and save the result in an entity.
I used the following command, which works wonderfully in the SSH terminal in HA:
ssh -o LogLevel=QUIET userid@hostname -t "apt-get -qq update && apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | wc -l"
I ran ssh-keygen and ssh-copy-id in the terminal so that remote clients can log in without a password.
If I pack the whole thing into configuration.yaml, the command ends with error code 255.
- platform: command_line
name: vzlooger Linux Update
command : "ssh -o LogLevel=QUIET userid@hostname -t \"apt-get -qq update && apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | wc -l\""
Where is my mistake?