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

Can't install from github? #23

Open
davidedelvento opened this issue Dec 15, 2017 · 4 comments
Open

Can't install from github? #23

davidedelvento opened this issue Dec 15, 2017 · 4 comments

Comments

@davidedelvento
Copy link

davidedelvento commented Dec 15, 2017

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
Copy link
Member

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

no test named 'equalto'

@davidedelvento
Copy link
Author

$ 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
Copy link
Member

@tersmitten
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants