ansible / ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com.

Home Page:https://www.ansible.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flag python-jmespath as PPA dependency

hillsy opened this issue Β· comments

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

json_query

ANSIBLE VERSION
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

CONFIGURATION

N/A

OS / ENVIRONMENT

Ubuntu 16.04 both client & server, Ansible installed from PPA.

SUMMARY

The json_query filter relies on the jmespath library.

While not strictly necessary for running Ansible, it is a very useful feature so it would be great if python-jmespath could be added as a dependency (or at least a recommend) for the official PPA.

This report is cribbed from a similar request for the shipped Debian package:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859999

Note that I also had this on a 14.04 box, and had some problems with python-jmespath as shipped by Ubuntu 14.04, so needed to install the 16.04 package. I don't know much about Ubuntu packaging; maybe this would be a problem.

definitely need this πŸ‘ ran into this issue running Ansible scripts for Elasticsearch: elastic/ansible-elasticsearch#321

python-jmespath should be also considered a dependecy if you install ansible via pip. It is not the case now:

$ pip download ansible -d /tmp --no-binary :all:
Collecting ansible
Using cached ansible-2.5.0.tar.gz
Saved /tmp/ansible-2.5.0.tar.gz
Collecting jinja2 (from ansible)
Downloading Jinja2-2.10.tar.gz (261kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 266kB 1.4MB/s
Saved /tmp/Jinja2-2.10.tar.gz
Collecting PyYAML (from ansible)
Using cached PyYAML-3.12.tar.gz
Saved /tmp/PyYAML-3.12.tar.gz
Collecting paramiko (from ansible)
Downloading paramiko-2.4.1.tar.gz (1.5MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.5MB 831kB/s
Saved /tmp/paramiko-2.4.1.tar.gz
Collecting cryptography (from ansible)
Downloading cryptography-2.2.2.tar.gz (443kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 450kB 1.9MB/s
Saved /tmp/cryptography-2.2.2.tar.gz
Collecting setuptools (from ansible)
Downloading setuptools-39.0.1.zip (844kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 849kB 1.2MB/s
Saved /tmp/setuptools-39.0.1.zip
Collecting MarkupSafe>=0.23 (from jinja2->ansible)
Using cached MarkupSafe-1.0.tar.gz
Saved /tmp/MarkupSafe-1.0.tar.gz
Collecting bcrypt>=3.1.3 (from paramiko->ansible)
Downloading bcrypt-3.1.4.tar.gz (42kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 51kB 10.1MB/s
Saved /tmp/bcrypt-3.1.4.tar.gz
Collecting pynacl>=1.0.1 (from paramiko->ansible)
Downloading PyNaCl-1.2.1.tar.gz (3.3MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.3MB 483kB/s
Saved /tmp/PyNaCl-1.2.1.tar.gz
Collecting pyasn1>=0.1.7 (from paramiko->ansible)
Downloading pyasn1-0.4.2.tar.gz (118kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 122kB 8.0MB/s
Saved /tmp/pyasn1-0.4.2.tar.gz
Collecting idna>=2.1 (from cryptography->ansible)
Downloading idna-2.6.tar.gz (135kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 143kB 3.8MB/s
Saved /tmp/idna-2.6.tar.gz
Collecting asn1crypto>=0.21.0 (from cryptography->ansible)
Downloading asn1crypto-0.24.0.tar.gz (104kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 112kB 6.5MB/s
Saved /tmp/asn1crypto-0.24.0.tar.gz
Collecting six>=1.4.1 (from cryptography->ansible)
Downloading six-1.11.0.tar.gz
Saved /tmp/six-1.11.0.tar.gz
Collecting cffi>=1.7 (from cryptography->ansible)
Downloading cffi-1.11.5.tar.gz (438kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 440kB 2.6MB/s
Saved /tmp/cffi-1.11.5.tar.gz
Collecting enum34 (from cryptography->ansible)
Downloading enum34-1.1.6.tar.gz (40kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 40kB 11.6MB/s
Saved /tmp/enum34-1.1.6.tar.gz
Collecting ipaddress (from cryptography->ansible)
Downloading ipaddress-1.0.22.tar.gz
Saved /tmp/ipaddress-1.0.22.tar.gz
Collecting pycparser (from cffi>=1.7->cryptography->ansible)
Using cached pycparser-2.18.tar.gz
Saved /tmp/pycparser-2.18.tar.gz
Successfully downloaded ansible jinja2 PyYAML paramiko cryptography setuptools MarkupSafe bcrypt pynacl pyasn1 idna asn1crypto six cffi enum34 ipaddress pycparser

This would have to be an optional dependency, or a recommends. json_query is not a core filter, and as such, we will not create a required dependency on this library.

As such, it will not be added to the pip installation method.

Does it need to be installed only on machine which runs Ansible playbook (my local lappy for example) or installed on all nodes that I want to deploy to and use json_query?

I installed jmespath locally with pip and the error "{"msg": "You need to install "jmespath" prior to running json_query filter"}" still happens. Why not ship ansible with aaaalll possible modules installed? :) we don't have a disk space problem in 2018, i'm fine to install 25gb Ansible with pip if it'll be its size with "all included" then be it :D

It does need to be installed locally. And installed in a path that the python binary used to invoke ansible will look for dependencies.

If you have further questions please stop by IRC or the mailing list:

it will not be added to the pip installation method

This issue was for the PPA installation method. If this isn't something that's ever going to be in the PPA that's fine, just wanted to be clear :)

Since this issue was first raised, I notice Debian have added python-jmespath as a recommends: https://packages.debian.org/buster/ansible

The same issue was also faced in the MacOS version 10.14 and with python 2.7 installed.

@sivel

I'm not sure I understand the argument that json_query is not a core filter. The code is in the main codebase, so surely the installation of its dependencies should be in extras_require at the very least?