Exam EX374 Topic 1 Question 44 Discussion

Actual exam question for RedHat's EX374 exam
Question #: 44
Topic #: 1
Retrieve a list of all system environment variables using the lookup plugin.

Suggested Answer:

- name: Get environment variables hosts: localhost
tasks:
- name: Fetch environment variables set_fact:
env_vars: "{{ lookup('env', '*') }}"
- debug:
var: env_vars
Explanation:
The env lookup plugin fetches system environment variables, allowing dynamic integration of host-specific configurations.

by Murphy at Oct 16, 2025, 09:03 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10