This commit is contained in:
2026-08-01 13:49:29 -05:00
parent 7859a609eb
commit ed627fbd19
6 changed files with 158 additions and 28 deletions
+9 -14
View File
@@ -1,34 +1,29 @@
---
- name: test-get_hpf_facts.yml
- name: test-get-hpf-facts.yml
hosts: all
tasks:
- name: Copy over get_hpf_facts.sh
- name: Copy over get-hpf-facts.sh
ansible.builtin.copy:
src: hpf-ans/bin/get_hpf_facts.sh
dest: bin/get_hpf_facts.sh
src: home/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
- name: Run get-hpf-facts.sh
ansible.builtin.command:
cmd: bin/get_hpf_facts.sh {{ ansible_facts["os_family"] }}
register: hpf_facts
cmd: bin/get-hpf-facts.sh {{ ansible_facts["os_family"] }}
register: registered_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]
hpf_facts: "{{ registered_hpf_facts.stdout | from_json }}"
- name: Print skel
ansible.builtin.debug:
var: hpf_fact_skel
var: hpf_facts.skel