mattmakai / fsp-deployment-guide

Companion code for the Full Stack Python Guide to Deployments book.
http://www.deploypython.com/
MIT License
122 stars 45 forks source link

Cannot deploy using ansible #12

Closed shalgrim closed 8 years ago

shalgrim commented 8 years ago

I can't run deploy_prod.sh as indicated in step 9 of page 77 of the pdf. I get an error about quotes around brackets, though that doesn't really seem to be the problem.

image

mattmakai commented 8 years ago

i've run into this error before @shalgrim, but can't be sure without seeing the nginx_ssl.conf.j2 file. can you post the contents of that? also are you using Ansible 1.9.4?

shalgrim commented 8 years ago

I'm using ansible 1.9.2 (the book says to install that one).

Attaching my file...other than spacing I don't detect any differences between what's on the site

nginx_ssl.conf.j2.txt

mattmakai commented 8 years ago

whats your app name? if it has spaces that might be causing an issue

mattmakai commented 8 years ago

if it's not app name then likely can get around it by using double quotes for the value after "dest="

shalgrim commented 8 years ago

Thanks, Matt. App name is cyoa. Adding quotes didn't help:

dest="/etc/nginx/conf.d{{ app_name }}.conf"

A couple of confusing things I had while I was running through the book, and I figure I might have guessed wrong at some point:

  1. which files go on my local machine v. which go on the server
  2. when I'm supposed to replicate literally "app_name" v. when I'm supposed to put in my app name
mattmakai commented 8 years ago

Yea, as the current version is written it can be a bit confusing where the files should live. Any Ansible tasks and templates should be on your local development machine so Ansible can execute the tasks and use the templates to generate configuration files on the server.

For 2., can you give specific pages numbers and locations where it's confusing? Any time you see {{ app_name }} in a template or task, it should not be replaced because it's a token. Only in the group_vars file would you want to replace the value with your own app name.

shalgrim commented 8 years ago

Page 69 of the pdf, where we create cyoa.conf, should that be locally or on the server? (I did it on the server.)

Also on page 69, that is super clear that I'm to change the server name, and I did so.

About that group_vals/all file, then, I've got cyoa set up at the top but then in the chapter four part (page 72), I've got app_name, that's right, right?

But then I left the fqdn as cyoa.mattmakai.com, and that can't be right, can it? It seems obvious now, but it must not have been obvious at the time. (I changed the fqdn to my URL and get the same parsing YAML error.)

mattmakai commented 8 years ago

All those are correct. Also, the fqdn wouldn't cause the error, although later on that would cause an issue. Want to hop on a google hangout to do a screen share? It'd be helpful to work through this and then I can make it more clear for future readers in the next update so hopefully they don't run into it. Shoot me an email at matthew.makai@gmail.com if you want to do that, my schedule is pretty open this afternoon (pacific time) and tomorrow.

shalgrim commented 8 years ago

@mattmakai graciously helped me figure out the issue was that .yml files needed things to line up perfectly, and always with spaces, never tabs