spurin / diveintoansible-lab

Dive Into Ansible Lab
776 stars 494 forks source link

Error while using template module in Ansible Playbooks - creation and execution #90

Closed THRINADH43 closed 2 years ago

THRINADH43 commented 2 years ago

Following the content in the course, Able to solve till now but unable to solve from creating a task in the template module Please look at the attachment for more reference. I tried checking indentation but didn't work. Please help me in solving this. Thanks in advance ansible playbook error 1 ansible playbook error .

spurin commented 2 years ago

Hi @THRINADH43

Nice to see you're progressing so well with the course! You're taking the challenge so, what is needed in this is to popular the group_vars

If you have a look in one of the previous revision's, you should just be able to recursively copy that directory and you'll be good.

Once done, have a look inside at the files and you'll see that the variables needed will be inside.

Hopefully this helps, don't hesitate to follow up if there's more problems.

Best Regards

James Spurin

THRINADH43 commented 2 years ago

Hi @spurin, The problem is resolved but I am constantly facing an issue. In all the hosts config files centos1 is configured to port 222. but To make this happen as discussed in the previous videos. If I change the uncomment to port 2222 line the docker-compose.yaml file then I am unable to run the centos1 and portal containter stating an error that " It is pre- occupied". Any suggestion on to change this?

and after running the current lesson. I got the new error. ansible playbook error 2 Is this because I changed the port to 22 from 2222 in hosts_var from centos1 or due to something else? Thanks in advance. with regards, Thrinadh

spurin commented 2 years ago

Perfect @THRINADH43

Yep, if you change it back you should be good to go. You could either manually change it or do

git checkout filename

To reset the file back to how it was from the repo 👍

THRINADH43 commented 2 years ago

Thanks for the help. With regards, Thrinadh Manubothu