0

I'm putting together a small ansible playbook to deploy a jekyll site and I'm running into some issues when running a task to update the codebase dependencies with bundler. I've tried debugging with the -vvv command line option and can't see anything obvious.

The target system is a default Ubuntu install with ruby, bundler, and a few other packages installed.

I've stripped everything down to the most basic example of the issue:

---
- hosts: all
  vars:
    location: /var/www/acodeninja.github.io
  tasks:
    - name: update codebase dependancies
      bundler:
        state: latest
        chdir: "{{ location }}/"

This runs but then hangs at the following stage:

TASK [update codebase dependancies]
task path: /home/lawrence/code/app-manager/tests/files/test-deployment.yml:6

If I alter the playbook to just run bundler using the command module I get the same issue:

---
- hosts: all
  vars:
    location: /var/www/acodeninja.github.io
  tasks:
    - name: update codebase dependancies
      command: bundle install
      args:
        chdir: "{{ location }}/"

Running supposedly the same command on the terminal we get an almost instant completion (using either bundle or bundler):

/var/www/acodeninja.github.io on master
$ bundle install
Using public_suffix 3.0.1
Using addressable 2.5.2
...
Using jekyll 3.6.2
Using jekyll-feed 0.9.2
Using jekyll-paginate 1.1.0
Using minima 2.1.1
Bundle complete! 5 Gemfile dependencies, 24 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

/var/www/acodeninja.github.io on master
$

Any suggestions on how to solve this issue or if this might be a bug in ansible would be great.

EDIT

The full playbook can be found here: https://gist.github.com/acodeninja/fb082cebec579db50c1b57303a8bbf77

Command being used to run playbook: ansible-playbook files/test-deployment.yml --ask-become-pass -vvv

onmylemon
  • 101
  • 3
  • 1
    run the task again with debug enabled `-vv`. Probably you will need to run the task with a different user. – Henrik Pingel Aug 23 '18 at 10:18
  • @HenrikPingel I've already run with `-vvv`, tried `-vv` and get less output (as expected) but it is still just stalling. The user isn't the issue as the user I am authenticating with does have the needed permissions (same user I am ssh-ing to the box as to run the command manually). It's worth mentioning that the section in my playbook to pull a git repo is working perfectly. Full playbook is here: https://gist.github.com/acodeninja/fb082cebec579db50c1b57303a8bbf77 and I'm running this with the following command: `ansible-playbook files/test-deployment.yml --ask-become-pass -vv` – onmylemon Aug 23 '18 at 10:36
  • 1
    How are you managing your ruby version? rvm? rbenv? Nothing? – Michael Hampton Aug 23 '18 at 13:53

0 Answers0