Implement yaml file download
This commit is contained in:
parent
a21c54cfe8
commit
af4e6ef214
3 changed files with 21 additions and 0 deletions
2
hosts/iron/services/esphome/devices/.env
Normal file
2
hosts/iron/services/esphome/devices/.env
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ESPHOME_HOST="192.168.42.1"
|
||||
ESPHOME_SECRETS_FILE="esphome_${ESPHOME_HOST}_secrets.yaml"
|
||||
2
hosts/iron/services/esphome/devices/.gitignore
vendored
Normal file
2
hosts/iron/services/esphome/devices/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/.esphome/
|
||||
/secrets.yaml
|
||||
17
hosts/iron/services/esphome/devices/justfile
Normal file
17
hosts/iron/services/esphome/devices/justfile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import '../../../../../justfile'
|
||||
set dotenv-load
|
||||
|
||||
download:
|
||||
rsync \
|
||||
-r \
|
||||
--rsync-path='sudo rsync' \
|
||||
--exclude '/build' \
|
||||
--exclude '/.esphome' \
|
||||
--exclude '.gitignore' \
|
||||
--exclude 'secrets.yaml' \
|
||||
192.168.42.1:/var/lib/esphome/ ./
|
||||
|
||||
download-secrets:
|
||||
umask 0077 && ssh 192.168.42.1 sudo cat /run/secrets/esphome > "/dev/shm/${ESPHOME_SECRETS_FILE}"
|
||||
ln -sf "/dev/shm/${ESPHOME_SECRETS_FILE}" "{{justfile_directory()}}/secrets.yaml"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue