Hi, i did the review-cr2 lab.
After configuring everything i still could not get curl servera to respond correctly
After some debugging, i found the templating part was unable to get hostvars['servera.lab.example.com']['ansible-facts']['default_ipv4'] "variable not defined" because the facts were empty
After trying may times to find whats wrong, even inserting al couple of debug statements en increasing verbose, and cheating at the example to look at the solution if i may have forgotten anything, i could not fix it.
So i just tried "lab grade" hoping it would give me another clue, but instead servera responded after the lab grade and i just "PASSED"
So i'm still dont know where of if i did something wrong.
Anyone else has this same issue or can give me another clue/tip?
Found it!!
Only running the 3 playbooks deploy_haproxy, deploy_apache and deploy_webapp individually is not enough.
Because playbook 2 references facts from servera that is only processed in playbook 1, all 3 playbooks need to run in the same executionenvironment-'session'.
In this way the executionevnrionment, 'cached' the servera-facts which can be references in other servers.
I failed to run 'site.yml' at the correct time, which does this.
The instruction is in there in the middle of the instructions, so... my mistake...
But hope this 'student-error' may help others if running into this same issue...
Found it!!
Only running the 3 playbooks deploy_haproxy, deploy_apache and deploy_webapp individually is not enough.
Because playbook 2 references facts from servera that is only processed in playbook 1, all 3 playbooks need to run in the same executionenvironment-'session'.
In this way the executionevnrionment, 'cached' the servera-facts which can be references in other servers.
I failed to run 'site.yml' at the correct time, which does this.
The instruction is in there in the middle of the instructions, so... my mistake...
But hope this 'student-error' may help others if running into this same issue...
@IvanLabrovic You have correctly identified the error that you missed to run the site.yml. Glad that you figured it out and you can continue from there.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.