Overview
JSON queries under Ansible fail because the Python module, jmespath , is not installed.
Also, the EXPECT module fails because the Python module, pexpect , is not installed.
References
Ubuntu Commands
Procedure
Install JMESPATH
Ran the following command:
sudo apt-get install python-jmespath
The output was:
[sudo] password for douglas: Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: python-jmespath 0 to upgrade, 1 to newly install, 0 to remove and 1 not to upgrade. Need to get 16.9 kB of archives. After this operation, 97.3 kB of additional disk space will be used. Get:1 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 python-jmespath all 0.9.0-2 [16.9 kB] Fetched 16.9 kB in 0s (32.5 kB/s) Selecting previously unselected package python-jmespath. (Reading database ... 101743 files and directories currently installed.) Preparing to unpack .../python-jmespath_0.9.0-2_all.deb ... Unpacking python-jmespath (0.9.0-2) ... Setting up python-jmespath (0.9.0-2) ...
Install PEXPECT
Ran the following command:
sudo apt-get install python-pexpect
The output was:
Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: python-ptyprocess Suggested packages: python-pexpect-doc The following NEW packages will be installed: python-pexpect python-ptyprocess 0 to upgrade, 2 to newly install, 0 to remove and 1 not to upgrade. Need to get 53.5 kB of archives. After this operation, 260 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 python-ptyprocess all 0.5-1 [12.9 kB] Get:2 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 python-pexpect all 4.0.1-1 [40.5 kB] Fetched 53.5 kB in 0s (129 kB/s) Selecting previously unselected package python-ptyprocess. (Reading database ... 101763 files and directories currently installed.) Preparing to unpack .../python-ptyprocess_0.5-1_all.deb ... Unpacking python-ptyprocess (0.5-1) ... Selecting previously unselected package python-pexpect. Preparing to unpack .../python-pexpect_4.0.1-1_all.deb ... Unpacking python-pexpect (4.0.1-1) ... Setting up python-ptyprocess (0.5-1) ... Setting up python-pexpect (4.0.1-1) ...