try to read var from config

This commit is contained in:
histausse 2022-03-06 17:28:17 +01:00
parent 00c2ce7443
commit 61a9070108
Signed by: histausse
GPG key ID: 67486F107F62E9E9

View file

@ -42,6 +42,25 @@
virtualenv_command: virtualenv
virtualenv_python: /usr/bin/python3
- name: Check if the bridge is already configured
stat:
path: /opt/mautrix-facebook/config.yaml
register: register_config
- name: Set read token variable
block:
- name: read config file
slurp:
src: /opt/mautrix-facebook/config.yaml
register: encoded_facebook_config
- name: decode config file
set_fact:
facebook_config: "{{ encoded_facebook_config.content | b64decode | from_yaml }}"
- name: print config
debug:
msg: "{{ facebook_config }}"
when: register_config.stat.exists
- name: Configure the bridge
template:
src: config.yaml