a-chernykh / railsbox

Fast and easy Ruby on Rails virtual machines
https://railsbox.io
MIT License
320 stars 52 forks source link

Ansible errors #37

Closed sergiovilla closed 8 years ago

sergiovilla commented 8 years ago

I'm getting the this error on many tasks One or more undefined variables: the inline if-expression on line 1 evaluated to false and no else section was defined

Firstly appears on

TASK: [postgresql | Assure that config dir exists]
fatal: [127.0.0.1] => One or more undefined variables: the inline if-expression on line 1 evaluated to false and no else section was defined.

If I delete that task then the same error appears on

TASK: [base |  Create temp directory]
fatal: [127.0.0.1] => One or more undefined variables: the inline if-expression on line 1 evaluated to false and no else section was defined.

Again, if I delete that task too, the same error appears on

TASK: [ruby | bundle install]
fatal: [127.0.0.1] => One or more undefined variables: the inline if-expression on line 1 evaluated to false and no else section was defined.

And so on:

TASK: [nginx | Copy nginx configuration] 
fatal: [127.0.0.1] => {'msg': 'AnsibleUndefinedVariable: One or more undefined variables: the inline if-expression on line 1 evaluated to false and no else section was defined.', 'failed': True}

I'm on Windows and this is my box

arifb commented 8 years ago

I was seeing this as well, but only occurred in TASK: [postgresql | Assure that config dir exists] so I fixed that. @sergiovilla I didn't have a look but I would assume that all your failing tasks are using app_path so this small fix should probably do the trick for them all.

a-chernykh commented 8 years ago

I've just deployed the change made by @arifb (thanks!). Can you please check if the issue has been solved for you now?

sergiovilla commented 8 years ago

Fixed, thanks.

I got the error

msg: Could not replace file: /home/vagrant/.ansible/tmp/ansible-tmp-1450453793.91-31133990673432/source to /my-app/config/unicorn.development.rb: [Errno 26] Text file busy

on the TASK: [unicorn | Configure unicorn] related to this issue

And fixed it replacing

- name: Configure unicorn
  template: src=unicorn.rb.j2 dest={{ unicorn_config_path }}

with:

- name: Create conf unicorn
  template: src=unicorn.rb.j2 dest=/tmp/unicorn.rb.tmp

- name: Copy unicron conf
  command: mv /tmp/unicorn.rb.tmp {{ unicorn_config_path }}