Kodekloud Engineer Ansible challenges

I started going through the Kodekloud engineer Ansible challenges, and I’m having a lot of correct work come up as incorrect. Is anyone else having a similar issue?

Please provide a screen shot of the task and a text copy of your ansible code in a code block </> (from the edit menu bar). I have completed all the ansible tasks and at the time there were no validation errors.

Here are some

The Nautilus DevOps team is executing Ansible using a sudo user on the jump host. They aim to automate certain Ansible playbook runs and ensure that Ansible does not prompt for a sudo password during playbook execution. As a result, they have outlined the following requirements to resolve this matter.

Ensure the necessary adjustments are made within the Ansible configuration located at /home/thor/ansible-t5q4/ansible-t5q4.cfg. Please refrain from creating a new configuration file.

appropriate changes are not changed to ‘True’ in config file ‘/home/thor/ansible-t5q4/ansible-t5q4.cfg’ on Jump Server

---- MY SOLUTION -----

[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=False

We plan to utilize various Ansible modules moving forward. To enhance our familiarity, the team intends to practice commonly used modules by creating playbooks for specific tasks.

Create a playbook named /home/thor/ansible/playbook-t1q4.yml on the jump host. Configure the playbook to generate a file named /tmp/file.txt on the jump host itself. Utilize the copy module and ensure the file contains the content: Welcome to the KKE Tests!

I WROTE A PLAYBOOK WITH 2 TASKS - CREATE FILE AND WRITE INTO FILE. I RAN IT AND IT RAN FINE.
Copy module neither creates a file, nor writes into a file. Was I supposed to make a file, write into it and then copy it to tmp?

a… On jump host create a playbook /home/thor/ansible/playbook-t2q3.yml to copy /usr/src/itadmin-t2q3/linux-t2q3.txt file on same host at location /opt/itadmin-t2q3.

Note: Validation will try to run the playbook using command ansible-playbook -i localhost playbook-t2q3.yml so please make sure the playbook works this way without passing any extra arguments.

We tried to run ‘/home/thor/ansible/playbook-t2q3.yml’ on Jump Server but it failed, please try to run the same manually to identify the issue

I RAN IT AS WELL AND IT RAN FINE WITH THAT COMMAND

IT ASKED ME TO MAKE A USER THAT CAN LOG INTO THE SERVERS WITHOUT THE SUDO PASSWORD. I MADE A REMOTE USER IN THE CFG FILE.

[defaults]
remote_user = thor

IT WORKED ONE TIME AND ANOTHER TIME IT DIDN’T

Without seeing your playbooks, the task description and the output it is very hard to help you. Also I don’t appreciate you shouting (typing in all caps) - it’s not going to solicit any further help from me.

Kindly, see yourself out of my thread. You should see a doctor about your psychological issues

Greetings,

Thank you for providing the details of the issues you’re encountering with the Kodekloud Engineer Ansible challenges. We understand that dealing with technical problems can be frustrating, and we appreciate your patience. We’re sorry for any inconvenience this may have caused.

To help us assist you more effectively, could you please provide specific details about the errors you are seeing? Screenshots, exact error messages, and the relevant playbook code would be very useful. This information will help us diagnose the issue and offer more precise guidance.

Let’s work together to solve these issues and help you succeed with your Ansible challenges, while keeping our communication respectful and solution-focused.

Thank you for your understanding and cooperation.

Hi Lakshay,
Unfortunately, I didn’t save the codes or take screenshots, and once I passed the test, I wasn’t given an opportunity to retake it to replicate the conditions for the errors.
My main concern was about the need for sudo password in 2 instances to run playbooks on the localhost. They both worked when I performed them during the exam, but once the exam was verified and those two were marked wrong, I re-ran the playbooks and got a sudo password error.

The other concern is related to the creation of a remote user. I typed it in the ansible.cfg file under the [defaults] parameter. It didn’t work 3 times in the practice question #3. The 4th time it worked. And it again, didn’t work in the test.

Thank you for your help

Hi @Tural-Abbasov

Thank you for sharing these details. Here are further insights regarding the points you mentioned:

  1. The /home/thor/ansible-t5q4/ansible-t5q4.cfg file serves as a sample Ansible configuration for practice. Ansible does not use this configuration by default; you must explicitly set the ANSIBLE_CONFIG variable for it to take effect. This may explain why your changes were not applied when testing. Additionally, we identified some flaws in this task and modified it for clarity.

  2. This task specifically requires the use of the copy module, which can create files and can write content into them. For detailed information, please refer to the official documentation: Ansible Copy Module.

  3. Without reviewing the original playbook you wrote, it’s challenging to determine why it may have failed. Playbooks can sometimes execute without achieving their intended outcomes, leading to incorrect final results.

  4. The task description specifies a user to be used across all remote servers, and thor was not intended to be that user.

These points should provide clarity on the issues encountered. Let me know if you need further assistance.

Thank you. I no longer see the first Ansible module on my list, but I think it answers all of my questions

1 Like