community / community.general / 3.8.10 / lookup / hiera get info from hiera data Authors: Juan Manuel Parrilla (@jparrill)community.general.hiera (3.8.10) — lookup
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Retrieves data from an Puppetmaster node using Hiera as ENC
# All this examples depends on hiera.yml that describes the hierarchy - name: "a value from Hiera 'DB'" ansible.builtin.debug: msg: "{{ lookup('community.general.hiera', 'foo') }}"
- name: "a value from a Hiera 'DB' on other environment" ansible.builtin.debug: msg: "{{ lookup('community.general.hiera', 'foo environment=production') }}"
- name: "a value from a Hiera 'DB' for a concrete node" ansible.builtin.debug: msg: "{{ lookup('community.general.hiera', 'foo fqdn=puppet01.localdomain') }}"
_bin_file: default: /usr/bin/hiera description: - Binary file to execute Hiera env: - name: ANSIBLE_HIERA_BIN _hiera_key: description: - The list of keys to lookup on the Puppetmaster elements: string required: true type: list _hierarchy_file: default: /etc/hiera.yaml description: - File that describes the hierarchy of Hiera env: - name: ANSIBLE_HIERA_CFG
_raw: description: - a value associated with input key elements: str type: list