Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant/Ansible provisioning broken #1596

Closed
adamyeats opened this issue Nov 22, 2016 · 6 comments
Closed

Vagrant/Ansible provisioning broken #1596

adamyeats opened this issue Nov 22, 2016 · 6 comments
Labels

Comments

@adamyeats
Copy link
Contributor

- name: Install Ruby 2.1
  apt: pkg={{ item }} state=latest
  with_items:
    - ruby2.2
    - ruby2.2-dev

Now that we've updated our Ruby version, the Ansible script does not completely provision as expected...

==> default: TASK: [app | Install Gems] ****************************************************
==> default: failed: [192.168.12.34] => {"changed": true, "cmd": "bundler install --path vendor/bundle -j1", "delta": "0:00:00.266953", "end": "2016-11-22 16:55:37.228239", "rc": 18, "start": "2016-11-22 16:55:36.961286"}
==> default: stdout: Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
==> default: installing your bundle as root will break this application for all non-root
==> default: users on this machine.
==> default: Your Ruby version is 2.2.5, but your Gemfile specified 2.3.2

@andrew, I'd suggest that one of us maybe updates the main.yml in the ruby role so that it uses rbenv? Not ideal as we'll have to jump through some extra hoops now e.g. rehashing, but the brightbox PPA that we use only has packages for up to MRI 2.3.1... keen to hear your thoughts on this one! ✌️

@adamyeats adamyeats added the bug label Nov 22, 2016
@adamyeats
Copy link
Contributor Author

I see we've had issues with this before in #1058... maybe there's some kind of sorcery we can use to parse .ruby-version on provision? Thus invalidating the need to keep updating the YAML.

@andrew
Copy link
Member

andrew commented Nov 22, 2016

Yeah I'm waiting on the brightbox PPA for Libraries too.

I don't really use the vagrant box myself, happy to add rbenv to the ansibles if it gets it working again before December though!

@adamyeats
Copy link
Contributor Author

Working on a fix for the Ansible files now! There's some syntax that needs updating for the latest Ansible version. PR incoming.

@adamyeats
Copy link
Contributor Author

A caveat: rbenv prefers to be local to the *nix user rather than global to all users, so I have assumed (based on the variables for pg that seem to suggest this) that the Ansible scripts will only be consumed by Vagrant (for the time being, at least). If we are also using this to provision a remote server, then we'll need a different solution to rbenv or a global install of rbenv (not recommended, stinks of hackiness) 👃

@andrew
Copy link
Member

andrew commented Nov 22, 2016

Would rvm be better?

@adamyeats
Copy link
Contributor Author

Difficult to say. I don't rate my knowledge of umask high enough to ensure a custom playbook for either rvm or rbenv would be idempotent enough for both a remote server and Vagrant. An apt package would almost certainly be the best way forward.

However, rvm has a reasonably up-to-date ansible-galaxy role that we might just be able to drop in to our playbook here. I'll test and see what happens.

@andrew andrew closed this as completed in ec3255f Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants