I would like to read a remote file content in an Ansible playbook.
- name: Load spark defaults
slurp:
src: /etc/spark/conf/spark-defaults.conf
register: spark_defaults
- debug:
msg: "{{ spark_defaults['content'] | b64decode }}"
I have read the documentation of both slurp and fetch and both mention they are intended to get the remote file. But the available parameters does not have the host.
I tried:
- name: Load spark defaults
slurp:
src: my.host://etc/spark/conf/spark-defaults.conf
register: spark_defaults
- name: Load spark defaults
slurp:
src: me@my.host://etc/spark/conf/spark-defaults.conf
register: spark_defaults
but cant seem to get it work. I guess I miss something fundamental and will really appreciate help here.