a-chernykh / railsbox

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

Assure app config initializers directory exists in redis task #40

Open cih opened 8 years ago

cih commented 8 years ago

Hey Folks,

Came across the following issue when provisioning a staging environment. Admittedly I am fairly new to both this tool (which is great btw!) and Ansible, but this adds a task that assures the directory exists before attempting to move the file across.

TASK [base : Configure redis-rb] ******************************************
fatal: [188.166.148.221]: FAILED! => {"changed": false, "failed": true, "msg": "Destination directory /rails_app/shared/config/initializers does not exist"} 

Hope this helps!

a-chernykh commented 8 years ago

Feels like we may need to revert https://github.com/andreychernih/railsbox/commit/4e98d55fc08716144e62b5841875a3517b724f0e instead

a-chernykh commented 8 years ago

I've just pushed 1.1.5 with the fix to this problem. Can you give me a favor and verify that this problem was fixed? You will need to re-download your box.

cih commented 8 years ago

Sure I will give it a spin and let you know, thanks for the fix!

cih commented 8 years ago

Sorry for the delay in getting back to you. I've just tested this out and I'm still seeing the same issue. I have included steps for reproduction including the server setup for completeness.

First up I create a DigitalOcean droplet (ubuntu 14.04.3) and add the user, sudo and ssh.

ssh root@serveriphere
adduser railsbox-testapp
visudo # railsbox-testapp ALL=(ALL) NOPASSWD: ALL
su railsbox-testapp
mkdir .ssh
chmod 700 .ssh
echo sshkeyhere > .ssh/authorized_keys
chmod 600 .ssh/authorized_keys

Then I clone down your test app locally and unzip the railsbox zip.

git clone git@github.com:andreychernih/railsbox-testapp.git
cd railsbox-testapp
cp ~/Downloads/railsbox-testapp-railsbox.zip .
unzip railsbox-testapp-railsbpx.zip

Update the group_vars in railsbox/ansible/group_vars/staging/config.yml to the following

---
rails_env: staging
target: server
vm_memory: 512
vm_swap: 512
vm_cores: 1
vm_share_type: nfs
vm_ip:
host: serverip
port: 22
username: railsbox-testapp

This fails for me at the same point as originally reported. Worth noting that running vagrant up in the development directory works fine. I've attached below the railsbox zip. Let me know if there is anything more I can do/provide?

Thanks!

railsbox-testapp-railsbox.zip