---
- name: Test slurp_rs module written in Rust
hosts: localhost
gather_facts: false
become: false
vars:
tmp_file: ../target/release/examples/hello_world
tasks:
- name: Create some file to work with
ansible.builtin.copy:
dest: "{{ tmp_file }}"
mode: "0644"
content: Hello world!
- name: Builtin slurp module on test file
ansible.builtin.slurp:
src: "{{ tmp_file }}"
register: slurp_py
- name: Rust slurp module on test file
slurp_rs:
src: "{{ tmp_file }}"
register: slurp_rs
- name: Compare results
ansible.builtin.assert:
that:
- slurp_py == slurp_rs