cancel
Showing results for 
Search instead for 
Did you mean: 
IvanLabrovic
Flight Engineer
Flight Engineer
  • 143 Views

LAB10 review-cr2

Jump to solution

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?

1 Solution

Accepted Solutions
IvanLabrovic
Flight Engineer
Flight Engineer
  • 132 Views

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...

View solution in original post

2 Replies
IvanLabrovic
Flight Engineer
Flight Engineer
  • 133 Views

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...

Chetan_Tiwary_
Community Manager
Community Manager
  • 103 Views

@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.

0 Kudos
Join the discussion
You must log in to join this conversation.