35 lines
813 B
YAML
35 lines
813 B
YAML
---
|
|
|
|
- name: test-get_hpf_facts.yml
|
|
hosts: all
|
|
|
|
tasks:
|
|
|
|
- name: Copy over get_hpf_facts.sh
|
|
ansible.builtin.copy:
|
|
src: hpf-ans/bin/get_hpf_facts.sh
|
|
dest: bin/get_hpf_facts.sh
|
|
owner: hpf-ans
|
|
group: hpf-ans
|
|
mode: u=rwx,go=gx
|
|
backup: true
|
|
|
|
- name: Run get_hpf_facts.sh
|
|
ansible.builtin.command:
|
|
cmd: bin/get_hpf_facts.sh {{ ansible_facts["os_family"] }}
|
|
register: hpf_facts
|
|
changed_when: false
|
|
|
|
- name: Convert k=v stdout into facts
|
|
ansible.builtin.set_fact:
|
|
"{{ item.split('=', 1)[0] }}": "{{ item.split('=', 1)[1] }}"
|
|
loop: "{{ hpf_facts.stdout.splitlines() }}"
|
|
|
|
- name: Print all variables
|
|
ansible.builtin.debug:
|
|
var: hostvars[inventory_hostname]
|
|
|
|
- name: Print skel
|
|
ansible.builtin.debug:
|
|
var: hpf_fact_skel
|