I have the following restful URL, which works when I call it.
temporarily_disable_pihole:
url: http://pihole.example.com/admin/api.php?disable=600&auth=ABCDEFG
However, I want to pass in a secret for the auth
portion. In fact, I want to use multiple secrets to build one string. Give secret’s A B C D
I’d like to be able to construct the URL with a template. How can I do this? The following doesn’t work, but it has the gist of what I’m trying to do.
rest_command:
temporarily_disable_pihole:
url: >
{%
set url = !secret A + !secret B + !secret C + !secret D
%}
{{ url }}
Most of my attempts generate an error when calling the restful command:
Failed to call service rest_command/temporarily_disable_pihole. local variable ‘request’ referenced before assignment