Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

Ansible core

ANSIBLE VERSION

ansible 2.2.1.0

CONFIGURATION

deafult, installed from Ansible ppa

OS / ENVIRONMENT

N/A

SUMMARY

Looks like new version of Ansible 2.2.1 fails in some cases when processing playbooks and templates

that have quotation

Previous version 2.2.0 works fine

STEPS TO REPRODUCE

this is from Kargo playbook, ansible playbook to install Kubernetes

works with Ansible 2.2.0 and fails with 2.2.1

- name: Register docker images info
shell: "{{ docker_bin_dir }}/docker images -q | xargs {{ docker_bin_dir }}/docker inspect -f {% raw %}'{{.RepoTags}},{{.RepoDigests}}'{% endraw %}"
register: docker_images_raw
failed_when: false
when: not download_always_pull|bool

this works for 2.2.1

- name: Register docker images info
raw: >-
{{ docker_bin_dir }}/docker images -q | xargs {{ docker_bin_dir }}/docker inspect -f "{{ '{{' }} .RepoTags {{ '}}' }},{{ '{{' }} .RepoDigests {{ '}}' }}"
register: docker_images_raw
failed_when: false
when: not download_always_pull|bool

EXPECTED RESULTS

At least some notes to Release Notes for 2.2.1 changes about quotation

ACTUAL RESULTS

I have automatic installation of Ansible from PPA, but with new version my roles are completely broken

and need to be reviewed/refactored.

Moreover, 2.2.0 is removed from PPA, so for me it is really disaster and work stopper.

Can you please put 2.2.0 back in PPA and PLEASE note in case of such significant changes.

Thanks!

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

shell module with {% raw %} tags

ANSIBLE VERSION

ansible 2.2.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A (CentOS 7.2 shouldn't be platform specific)

SUMMARY

This is quite meta .. but I will try and explain.

We use the ansible shell command to run some commands against docker hosts which uses dockers --format feature that feature relies on GO template engine. Naturally we see conflicting behaviour here due to both jinja2 and go using '{{' as delimeters. AFAIK neither of these tools currently support switching delimeters but I may be wrong as that would be one way we could work around this..

We pass a {% raw %}{% endraw %} wrapped go template to a shell module calling docker like:

- name: Count running images to check if down scaling is necessary
shell:
"docker ps -a --no-trunc --filter name=^/{{artifact.namespace}}-{{ artifact.name }} --format='{% raw %}{{.ID}},{{.Image}}{% endraw %}' | wc -l"
register: docker_container_count

- name: Debug the count
debug:
msg: "{{ docker_container_count }}"

The command executes successfully in both Ansible 2.1.1.0 and Ansible 2.2.1.0

however

The internal representation 'cmd' key representing the original command was stored using the jinja tags as '{#' and now it is being stored verbatim like '{{'. This is causing any further usage of this registered variable to fail as jinja is trying to parse the 'cmd' string.

debug output before upgrade (v2.1.1.0):

16:33:28 TASK [microservices : Debug the count] *************************
16:33:28 ok: [hostname.company.org] => {
16:33:28 "msg": {
16:33:28 "changed": true,
16:33:28 "cmd": "docker ps -a --no-trunc --filter name=^/edge-server--account-service --format='{#.ID#},{#.Image#}' | wc -l",
16:33:28 "delta": "0:00:00.025972",
16:33:28 "end": "2017-01-23 16:33:27.970780",
16:33:28 "rc": 0,
16:33:28 "start": "2017-01-23 16:33:27.944808",
16:33:28 "stderr": "",
16:33:28 "stdout": "1",
16:33:28 "stdout_lines": [
16:33:28 "1"
16:33:28 ],
16:33:28 "warnings": []
16:33:28 }
16:33:28 }
16:33:28

debug output after upgrade (v2.2.1.0):

16:07:24 TASK [microservices : Debug the count] ***********************************
16:07:24 fatal: [hostname.company.org]: FAILED! =>
{"failed": true,
"msg": "{
u'cmd': u\"docker ps -a --no-trunc --filter name=^/edge-server--account-service --format='{{.ID}},{{.Image}}' | wc -l\",
u'end': u'2017-01-23 16:07:24.798553',
u'stdout': u'1',
u'changed': True,
u'start': u'2017-01-23 16:07:24.763174',
u'delta': u'0:00:00.035379',
u'stderr': u'',
u'rc': 0,
'stdout_lines': [u'1'],
u'warnings': []}:
template error while templating string: unexpected '.'. String: docker ps -a --no-trunc --filter name=^/edge-server--account-service --format='{{.ID}},{{.Image}}' | wc -l"
}
16:07:24	to retry, use: --limit @/home/jenkins/workspace/DeploymentFolder/DeployEdgeServer/rolling_deployment.retry
16:07:24