Exam EX374 Topic 1 Question 44 Discussion
Actual exam question for RedHat's EX374 exam
Question #: 44
Topic #: 1
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.
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
0
0
0
10
Comments
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.
Report Comment
Commenting
You can sign-up / login (it's free).