Oefenweb / ansible-r

Ansible role to set up (the latest version of) R in Ubuntu systems
MIT License
42 stars 27 forks source link

Can't install from github? #23

Open davidedelvento opened 6 years ago

davidedelvento commented 6 years ago

I'm trying to install stuff from github following the suggestions in issue #21 and the README, but it fails as follows.

My playbook (basically cut-and-paste of the the README):

---
- hosts: all
  roles:
    - tersmitten.r
  vars:
    r_packages:
      - name: mangothecat/franc
        type: github

The error:

< TASK [tersmitten.r : packages | install] >
 ------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: /etc/ansible/roles/tersmitten.r/tasks/packages.yml:24
The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 89, in run
    items = self._get_loop_items()
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 202, in _get_loop_items
    loop_terms = listify_lookup_plugin_terms(terms=self._task.loop_args, templar=templar, loader=self._loader, fail_on_undefined=True, convert_bare=False)
  File "/usr/local/lib/python2.7/dist-packages/ansible/utils/listify.py", line 34, in listify_lookup_plugin_terms
    terms = templar.template(terms.strip(), convert_bare=convert_bare, fail_on_undefined=fail_on_undefined)
  File "/usr/local/lib/python2.7/dist-packages/ansible/template/__init__.py", line 437, in template
    disable_lookups=disable_lookups,
  File "/usr/local/lib/python2.7/dist-packages/ansible/template/__init__.py", line 659, in do_template
    res = j2_concat(rf)
  File "<template>", line 7, in root
  File "/usr/local/lib/python2.7/dist-packages/ansible/template/__init__.py", line 197, in resolve
    val = super(AnsibleContext, self).resolve(key)
  File "/usr/lib/python2.7/dist-packages/jinja2/runtime.py", line 153, in resolve
    return self.parent[key]
  File "/usr/local/lib/python2.7/dist-packages/ansible/template/vars.py", line 95, in __getitem__
    raise type(e)(to_native(variable) + ': ' + e.message)
TemplateRuntimeError: {{ r_packages | selectattr('type', 'defined') | selectattr('type', 'equalto', 'github') | map(attribute='name') | list | length > 0 }}: no test named 'equalto'

fatal: [149.165.156.235]: FAILED! => {
    "failed": true
}

MSG:

Unexpected failure during module execution.

 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

IP_NUMBER_EDITED            : ok=6    changed=0    unreachable=0    failed=1   

PS: this is tersmitten.r v1.4.1, last available from the galaxy

tersmitten commented 6 years ago

What version of Ansible (and Jinja) are you using. It seems that it cannot find the equal to filter:

no test named 'equalto'

davidedelvento commented 6 years ago
$ python -c "import jinja2; print jinja2.__version__"
2.7.2

$ ansible-playbook --version
ansible-playbook 2.3.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/usr/share/ansible']
  python version = 2.7.6 (default, Nov 23 2017, 15:49:48) [GCC 4.8.4]
tersmitten commented 6 years ago

https://github.com/ansible/ansible/issues/10123#issuecomment-71949731

tersmitten commented 6 years ago

How did you install Ansible and are you able to update Jinja?