Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

RedHat EX294 Exam - Topic 5 Question 62 Discussion

Create and run an Ansible ad-hoc command.--> As a system administrator, you will need to install software on the managednodes.--> Create a shell script called yum-pack.sh that runs an Ansible ad-hoc command tocreate yum-repository on each of the managed nodes as follows:--> repository1-----------1. The name of the repository is EX4072. The description is "Ex407 Description"3. The base URL is http://content.example.com/rhel8.0/x86_64/dvd/BaseOS/4. GPG signature checking is enabled5. The GPG key URL is http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEYredhat-release6. The repository is enabled--> repository2-----------1. The name of the repository is EXX4072. The description is "Exx407 Description"3. The base URL is http://content.example.com/rhel8.0/x86_64/dvd/AppStream/4. GPG signature checking is enabled5. The GPG key URL is http://content.example.com/rhel8.0/x86_64/dvd/ RPM-GPG-KEYredhat-release6. The repository is enabled
A) Explanation: Solution as: # pwd /home/admin/ansible # vim yum-pack.sh #!/bin/bash ansible all -m yum_repository -a 'name=EX407 description='Ex407 Description' baseurl=http://content.example.com/rhel8.0/x86_64/dvd/BaseOS/ gpgcheck=yes gpgkey=http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release enabled=yes' ansible all -m yum_repository -a 'name=EXX407 description='Exx407 Description' baseurl=http://content.example.com/rhel8.0/x86_64/dvd/AppStream/ gpgcheck=yes gpgkey=http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEY-redhat-release enabled=yes' :!wq # chmod +x yum-pack.sh # bash yum-pack.sh # ansible all -m command -a 'yum repolist all'

RedHat EX294 Exam - Topic 5 Question 62 Discussion

Actual exam question for RedHat's EX294 exam
Question #: 62
Topic #: 5
[All EX294 Questions]

Create and run an Ansible ad-hoc command.

--> As a system administrator, you will need to install software on the managed

nodes.

--> Create a shell script called yum-pack.sh that runs an Ansible ad-hoc command to

create yum-repository on each of the managed nodes as follows:

--> repository1

-----------

1. The name of the repository is EX407

2. The description is "Ex407 Description"

3. The base URL is http://content.example.com/rhel8.0/x86_64/dvd/BaseOS/

4. GPG signature checking is enabled

5. The GPG key URL is http://content.example.com/rhel8.0/x86_64/dvd/RPM-GPG-KEYredhat-

release

6. The repository is enabled

--> repository2

-----------

1. The name of the repository is EXX407

2. The description is "Exx407 Description"

3. The base URL is http://content.example.com/rhel8.0/x86_64/dvd/AppStream/

4. GPG signature checking is enabled

5. The GPG key URL is http://content.example.com/rhel8.0/x86_64/dvd/ RPM-GPG-KEYredhat-

release

6. The repository is enabled

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Elvera
9 months ago
Not sure if I trust that base URL, looks sketchy.
upvoted 0 times
...
Merilyn
9 months ago
I thought you had to manually create repos, this is a game changer!
upvoted 0 times
...
Carlton
9 months ago
Just ran the command, worked like a charm!
upvoted 0 times
...
Shelton
9 months ago
Wait, did you say GPG checking is enabled? That's awesome!
upvoted 0 times
...
Adria
9 months ago
I love how simple Ansible makes this!
upvoted 0 times
...
Tamesha
10 months ago
I remember we had to make the script executable with `chmod +x`, but I'm unsure if I need to run the command as root or not.
upvoted 0 times
...
Stephaine
10 months ago
I feel a bit confused about the order of parameters in the ad-hoc command. Did we cover if the description should be in quotes or not?
upvoted 0 times
...
Carol
10 months ago
I practiced a similar question where we had to create a repository, but I can't recall if I need to specify the GPG key URL correctly in the command.
upvoted 0 times
...
Tatum
10 months ago
I think I remember how to use the `yum_repository` module, but I'm not sure about the exact syntax for the ad-hoc command.
upvoted 0 times
...
Shalon
11 months ago
Alright, let's do this. I'll create the shell script, run the Ansible commands, and verify the repositories are set up correctly. Shouldn't be too difficult.
upvoted 0 times
...
Goldie
11 months ago
Okay, this seems doable. I'll need to be careful with the URLs and GPG key details, but I think I can get this done.
upvoted 0 times
...
Yolando
11 months ago
No problem, I've done this kind of thing before. I'll just need to make sure I have the repository details correct and that the script runs without any issues.
upvoted 0 times
...
Dewitt
11 months ago
Hmm, I'm a bit unsure about the exact syntax for the Ansible ad-hoc commands. I'll need to review the module documentation to make sure I get the parameters right.
upvoted 0 times
...
Junita
11 months ago
This looks pretty straightforward. I think I can handle this. I'll just need to create the shell script and run the Ansible ad-hoc commands as specified.
upvoted 0 times
...
Irving
1 year ago
I bet the person who wrote this script has a Ph.D. in 'Ansible Awesomeness'. I mean, who else would come up with such a slick solution? Kudos to them!
upvoted 0 times
Staci
1 year ago
It's impressive how they managed to make the whole process so efficient.
upvoted 0 times
...
Bettyann
1 year ago
I wish I had the skills to come up with something like this.
upvoted 0 times
...
Juliann
1 year ago
Definitely! Whoever wrote this script must be an Ansible genius.
upvoted 0 times
...
Wilda
1 year ago
I know right! This script is so well-written, it's like a work of art.
upvoted 0 times
...
...
Terrilyn
1 year ago
This is exactly the kind of task I was hoping to learn about. I can see how using Ansible ad-hoc commands can make our lives as sysadmins much easier. Time to start practicing!
upvoted 0 times
Mitzie
1 year ago
I agree, practicing with Ansible ad-hoc commands will definitely help us become more efficient sysadmins.
upvoted 0 times
...
Samira
1 year ago
Yes, Ansible ad-hoc commands definitely simplify the process of managing configurations across multiple servers.
upvoted 0 times
...
Valda
1 year ago
That script looks really useful for setting up yum repositories on multiple nodes.
upvoted 0 times
...
...
Brande
1 year ago
Haha, I love the idea of running 'yum repolist all' at the end to verify that everything worked as expected. It's like a built-in quality check!
upvoted 0 times
Jerry
1 year ago
Carmela: Plus, it gives you peace of mind knowing everything is set up as intended.
upvoted 0 times
...
Carmela
1 year ago
User 2: Definitely, it's always good to have a verification step in place.
upvoted 0 times
...
Verda
1 year ago
User 1: I agree, it's a smart way to make sure the repositories were created correctly.
upvoted 0 times
...
...
Elke
1 year ago
Hmm, I wonder if there's a way to make the script more dynamic, so we can easily add or modify the repo details without having to update the script itself. Maybe using a config file or something?
upvoted 0 times
Virgie
1 year ago
User1
upvoted 0 times
...
Natalya
1 year ago
User2
upvoted 0 times
...
Dominga
1 year ago
User1
upvoted 0 times
...
...
Elke
1 year ago
Wow, this is a great way to automate the creation of Yum repositories across multiple nodes. I like how the script uses Ansible ad-hoc commands to make it easy to deploy and manage the repos.
upvoted 0 times
Tammara
1 year ago
Absolutely, it saves a lot of time and ensures consistency across all nodes.
upvoted 0 times
...
...
Ellen
1 year ago
I feel confident about running the shell script yum-pack.sh as it simplifies the task of creating and enabling repositories on multiple nodes.
upvoted 0 times
...
Meaghan
1 year ago
I agree with you, Omer. It helps in automating the process and ensures consistency across all managed nodes.
upvoted 0 times
...
Omer
1 year ago
I think creating the Ansible ad-hoc command for setting up yum repositories is important for managing nodes efficiently.
upvoted 0 times
...

Save Cancel