cancel
Showing results for 
Search instead for 
Did you mean: 
TiffanyA
Flight Engineer
Flight Engineer
  • 3,186 Views

RH294 Ch.4 Lab

I've been struggling for nearly 2 hours trying to figure out where my mistake is in this lab. After creating the playbook and running the play, I keep receiving the message "auth_test.content": VARIABLE IS NOT DEFINED! on the debug task. I took a screenshot; it is the last task performed. 

Screen Shot 07-22-20 at 03.06 PM.PNG

 

Here is a screenshot of the entire playbook, I can't seem to find my error, though I think it has something to do 'Create index.html' task but I'm not sure what to do to fix it. Any help or suggestions would be greatly appreciated!

Screen Shot 07-22-20 at 03.03 PM.PNGScreen Shot 07-22-20 at 03.04 PM.PNGScreen Shot 07-22-20 at 03.05 PM.PNG

"Success doesn't come from what you do occasionally, it comes from what you do consistently." ~Maria Forleo
Labels (2)
0 Kudos
6 Replies
Vicente
Flight Engineer Flight Engineer
Flight Engineer
  • 3,183 Views

Hi @TiffanyA,

Why don't you try print auth_test? If content doesn't exist there, it should at least contain some other information, since it's a dictionary anyway.

Another thing to try, and this is really a long shot, would be printing auth_test['content'] insteand of auth_test.content. This could only work if the previous step was successful.

And if none of these ideas work, try to curl the webserver from the shell and see what it returns (old methods always work).

Let me know how it goes :-)

TiffanyA
Flight Engineer
Flight Engineer
  • 3,162 Views

@Vicente , thank you so much for the response. I went back to the lab to try your suggested solutions, when I actually figured out my error....the 'register' module should be aligned with 'uri' module.  Well, I feel a bit sheepish now. I guess I just needed to step away and try again with a fresh set of eyes. I appreciate your suggestions and sorry to waste your time!

Screen Shot 07-22-20 at 03.05 PM_LI.jpg

"Success doesn't come from what you do occasionally, it comes from what you do consistently." ~Maria Forleo
0 Kudos
Vicente
Flight Engineer Flight Engineer
Flight Engineer
  • 3,157 Views

@TiffanyA, I didn't spot that either, well done.
Any reason why using so much padding? It's going to be a mess when you have to work in a team.

And you didn't waste my time at all, I enjoy those "challenges" too :-)

0 Kudos
TiffanyA
Flight Engineer
Flight Engineer
  • 3,148 Views

This is actually a lab for RH294 course being taught at my school. I was just following the student workbook (well, the online book) that came with it. I'm a lab tech so this summer, I've been proofing labs to make sure there aren't any hiccups or instructional errors.  What do you mean by padding?....I'm curious!

"Success doesn't come from what you do occasionally, it comes from what you do consistently." ~Maria Forleo
0 Kudos
Vicente
Flight Engineer Flight Engineer
Flight Engineer
  • 3,144 Views

Ansible is not the only language that uses YAML. As an example, I quote from the SaltStack website: "The suggested syntax for YAML files is to use 2 spaces for indentation, but YAML will follow whatever indentation system that the individual file uses. Indentation of two spaces works very well for SLS files given the fact that the data is uniform and not deeply nested."

Basically what I meant is that code doesn't need to be only functional, it can also be pretty ;-)

TiffanyA
Flight Engineer
Flight Engineer
  • 3,139 Views

Ah, I see. Pretty AND functional...I like! I will keep that in mind for future ansible labs. Thanks for the tip! :)
"Success doesn't come from what you do occasionally, it comes from what you do consistently." ~Maria Forleo
0 Kudos
Join the discussion
You must log in to join this conversation.