New Year Sale 2026! 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 1 Question 56 Discussion

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

Create a file called adhoc.sh in /home/sandy/ansible which will use adhoc commands to set up a new repository. The name of the repo will be 'EPEL' the description 'RHEL8' the baseurl is 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rmp' there is no gpgcheck, but you should enable the repo.

* You should be able to use an bash script using adhoc commands to enable repos. Depending on your lab setup, you may need to make this repo "state=absent" after you pass this task.

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Jose
3 months ago
I’m surprised this works without any additional dependencies.
upvoted 0 times
...
Layla
3 months ago
Looks good to me, I've used similar commands before!
upvoted 0 times
...
An
3 months ago
Wait, is it really necessary to set gpgcheck to no? Seems risky.
upvoted 0 times
...
Ellen
4 months ago
Totally agree, that could cause issues when running the script.
upvoted 0 times
...
Mirta
4 months ago
Just a heads up, the baseurl link has a typo, it should be .rpm not .rmp.
upvoted 0 times
...
Mozell
4 months ago
I remember needing to set `state=absent` in a previous exercise, but I can't remember if that was for enabling or disabling a repo.
upvoted 0 times
...
Jesusa
4 months ago
I feel like I need to double-check the path for the bash shebang line; I think it should be `#!/bin/bash`, but I might be mixing it up with something else.
upvoted 0 times
...
Edgar
4 months ago
I practiced a similar question where we had to enable a repo, but I can't recall if I used `enabled=yes` or `enabled=true`.
upvoted 0 times
...
Alisha
5 months ago
I think I remember using the `yum_repository` module for setting up repos, but I'm not entirely sure about the syntax for the baseurl.
upvoted 0 times
...
Tracie
5 months ago
Alright, I've got this. I'll create the script, use the `yum_repository` module to set up the EPEL repo, and then check if I need to remove it afterwards. Feels like a good opportunity to practice my Ansible skills.
upvoted 0 times
...
Caprice
5 months ago
This looks straightforward enough. I'll make sure to use the correct Ansible module and parameters to enable the EPEL repo as specified. Shouldn't be too difficult as long as I follow the instructions carefully.
upvoted 0 times
...
Emiko
5 months ago
I'm a bit confused about the "state=absent" part at the end. Does that mean I need to remove the repo after setting it up? I'll have to double-check the instructions on that.
upvoted 0 times
...
Kenny
5 months ago
Okay, let me think this through step-by-step. First, I'll create the `adhoc.sh` file in the `/home/sandy/ansible` directory. Then, I'll use the `ansible` command to run the `yum_repository` module with the specified parameters.
upvoted 0 times
...
Tiera
5 months ago
Hmm, this looks like a straightforward task. I'll need to create a bash script and use Ansible's `yum_repository` module to set up the EPEL repo.
upvoted 0 times
...
Lauran
10 months ago
Wait, did someone say 'chmod 0777'? That's a bit overkill, don't you think? Let's keep the permissions a bit more secure, shall we?
upvoted 0 times
Yvette
8 months ago
User1: Agreed, let's update the permissions to 0755 for better security.
upvoted 0 times
...
Kirk
8 months ago
User2: Good point, 0755 is a better choice for file permissions.
upvoted 0 times
...
Bernadine
8 months ago
User1: You're right, 0777 is too permissive. Let's use more secure permissions like 0755.
upvoted 0 times
...
...
Callie
10 months ago
This is a great question! I'm surprised they didn't ask us to use the 'yum_repository' module instead of the 'ansible' command directly.
upvoted 0 times
...
Ashlyn
10 months ago
Haha, the script is almost perfect, but I think we need to add a 'reponame=EPEL' parameter to match the name specified in the question.
upvoted 0 times
Monte
8 months ago
Great suggestion! I'll add 'reponame=EPEL' to the adhoc.sh script for accuracy.
upvoted 0 times
...
Gearldine
9 months ago
Adding 'reponame=EPEL' will ensure the repo name matches the specified name. I'll update the script.
upvoted 0 times
...
Skye
9 months ago
Thanks for pointing that out. I'll make sure to include 'reponame=EPEL' in the script.
upvoted 0 times
...
Joni
10 months ago
Good catch! Let's add 'reponame=EPEL' to the adhoc.sh script.
upvoted 0 times
...
...
Jame
10 months ago
The script looks good, but I would suggest adding a 'become: yes' parameter to the ansible command to ensure the task is executed with elevated privileges.
upvoted 0 times
Gary
9 months ago
Good idea, I'll include 'become: yes' to ensure elevated privileges for the task.
upvoted 0 times
...
Devora
9 months ago
Thanks for the suggestion! I'll make sure to add 'become: yes' to the ansible command.
upvoted 0 times
...
...
Elden
11 months ago
This seems like a straightforward task. The provided script looks good, though I might add a 'state=present' parameter to ensure the repository is enabled.
upvoted 0 times
Sharita
9 months ago
User 4: Good point, that would make sure everything is set up correctly.
upvoted 0 times
...
Lenna
9 months ago
User 3: I might add a 'state=present' parameter to ensure the repository is enabled.
upvoted 0 times
...
Aleisha
10 months ago
User 2: Yeah, the provided script looks good.
upvoted 0 times
...
Burma
10 months ago
User 1: This seems like a straightforward task.
upvoted 0 times
...
...
Tanesha
11 months ago
Yes, the bash script example given for enabling the repo makes it easier to understand the steps involved.
upvoted 0 times
...
Delsie
11 months ago
I agree, but the explanation provided for creating the repo using adhoc commands seems clear and helpful.
upvoted 0 times
...
Tanesha
11 months ago
I think creating the adhoc.sh file in /home/sandy/ansible to set up a new repository sounds challenging.
upvoted 0 times
...

Save Cancel