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.
"changed": false,
"failed": true,
"module_stderr": "Shared connection to 192.168.0.10 closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_grpdvu33/ansible_module_jenkins_script.py\", line 196, in <module>\r\n main()\r\n File \"/tmp/ansible_grpdvu33/ansible_module_jenkins_script.py\", line 171, in main\r\n if is_csrf_protection_enabled(module):\r\n File \"/tmp/ansible_grpdvu33/ansible_module_jenkins_script.py\", line 129, in is_csrf_protection_enabled\r\n return json.loads(content).get('useCrumbs', False)\r\n File \"/usr/lib/python3.5/json/__init__.py\", line 312, in loads\r\n s.__class__.__name__))\r\nTypeError: the JSON object must be str, not 'bytes'\r\n",
"msg": "MODULE FAILURE",
"rc": 0
}
ISSUE TYPE
COMPONENT NAME
jenkins_script
ANSIBLE VERSION
CONFIGURATION
"ansible-config dump --only-changed"
ansible.cfg [defaults] roles_path = ../ansible-roles/
inventory [jenkins] 192.168.0.12 ansible_python_interpreter=/usr/bin/python3
OS / ENVIRONMENT
Ubuntu 16.04 (Both)
SUMMARY
Similar to #24526 jenkins_script will fail when inventory file forces Python3 interpeter i.e.
[jenkins] 192.168.0.12 ansible_python_interpreter=/usr/bin/python3
Error:
STEPS TO REPRODUCE
EXPECTED RESULTS
List of actual plugins via the output i.e.
ACTUAL RESULTS
Workaround remove
ansible_python_interpreter=/usr/bin/python3
from inventory file