quick_test/check_rear.yml

32 lines
808 B
YAML

---
- name: Something
hosts: temp
become: false
gather_facts: true
tasks:
- name: Read the conf file
ansible.builtin.slurp:
src: /etc/rear/local.conf
register: slurp_local_conf
- name: Debug local_conf_content
ansible.builtin.debug:
var: slurp_local_conf
- name: Decode the conf file content
ansible.builtin.set_fact:
local_conf_content: "{{ slurp_local_conf['content'] | b64decode }}"
- name: Debug local_conf_content
ansible.builtin.debug:
var: local_conf_content
- name: Extract the NFS server address
ansible.builtin.set_fact:
nfs_server: "{{ local_conf_content | regex_search('nfs://(.*?)/', '\\1') | first }}"
- name: Debug nfs_server
ansible.builtin.debug:
var: nfs_server