liip / drifter

Drifter is a framework to help provision developer boxes using Ansible and Vagrant
https://liip-drifter.readthedocs.io/
Do What The F*ck You Want To Public License
57 stars 28 forks source link

Role nodejs fails #248

Closed ghn closed 5 years ago

ghn commented 5 years ago

Using a fresh box with role "nodejs" leads to this error while provisioning:

TASK [nodejs : Install npm packages] *******************************************
ERROR! the field 'hosts' is required but was not set
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Drifter version: v1.7.0 and commit 46d4a9d (master) Vagrant version: 2.2.2 OS and version: osx 10.14.2

Configuration files:

playbook.yml

- hosts: all
  vars_files:
   - parameters.yml
  become: no

  roles:
    - { role: base }
    - { role: git }
    - { role: postgresql }
    - { role: ssh }
    - { role: ruby }
    - { role: nodejs, nodejs_with_yarn: true }

Additional information:

LeBenLeBen commented 5 years ago

@ghn I tried with a fresh box and your playbook and the provisioning succeeded. It looks like this error can be caused by syntax errors in the playbook (see https://stackoverflow.com/questions/36724870/ansible-error-the-field-hosts-is-required-but-was-not-set). Could you double check yours and try again?

Also did you specify any custom settings in your parameters.yml file?

sephii commented 5 years ago

I wasn't able to reproduce either. On an unrelated note this made me realize the ruby role doesn't work on Debian Stretch so I fixed it in https://github.com/liip/drifter/commit/500d0de225429a04fd15fd9ec39e164d1b252978.

Feel free to reopen this issue if the problem persists and if you're able to provide reproduction steps.