Host 'stapp01' is not added correctly in '/home/thor/ansible/inventory' file on Jump Server

kodekloud engineer ansible practice test task check failed -
host ‘stapp01’ is not added correctly in ‘/home/thor/ansible/inventory’ file on Jump Server

But I am able to successfully run the playbook. Please suggest by reviewing the below.

==============
thor@jumphost ~$ ansible-playbook -i ansible/inventory playbook.yml

PLAY [Create a file on App Server 1] *************************************************************

TASK [Gathering Facts] ***************************************************************************
ok: [stapp01]

TASK [Create an empty file /tmp/file.txt] ********************************************************
changed: [stapp01]

PLAY RECAP ***************************************************************************************
stapp01 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

thor@jumphost ~$


  • name: Create a file on App Server 1
    hosts: app_servers
    become: yes
    tasks:
    • name: Create an empty file /tmp/file.txt
      file:
      path: /tmp/file.txt
      state: touch

[app_servers]
stapp01 ansible_host=172.16.238.10 ansible_user=tony ansible_ssh_common_args=‘-o StrictHostKeyChecking=no’ ansible_ssh_pass=xxxxxxx


Hi @Prateek

With the log dump you’ve provided it’s hard to infer what are you referring to when you say:

host ‘stapp01’ is not added correctly in ‘/home/thor/ansible/inventory’ file on Jump Server

You could have used code blocks by using the </> button in the ribbon located at the top of the editor.

Can you please share the lab link and point to what exactly is wrong with the inventory file in this lab?

https://engineer.kodekloud.com/public-review?task_id=64072075741b204d59fbea25&user_id=64ad5e58803455eea0a852d2

Task Details
An Ansible playbook needs completion on the jump host, where a team member left off. Below are the details:

  1. The inventory file /home/thor/ansible/inventory requires adjustments. The playbook must run on App Server 1 in Stratos DC. Update the inventory accordingly.

  2. Create a playbook /home/thor/ansible/playbook.yml. Include a task to create an empty file /tmp/file.txt on App Server 1.

Note: Validation will run the playbook using the command ansible-playbook -i inventory playbook.yml. Ensure the playbook works without any additional arguments.

Please provide the right solution to pass this ansible practice task.

So, it’s a KodeKloud Engineer task. You posted it in Infrastructure as code category.

Can you share the Level and name of this Ansible task?

Level 1 Ansible Task -
Troubleshoot and Create Ansible Playbook

You can now ignore this issue , I am able to complete this task successfully.