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

--diff flag stopped producing the diff from file module #41755

Closed
AlanCoding opened this issue Jun 20, 2018 · 4 comments · Fixed by #41760
Closed

--diff flag stopped producing the diff from file module #41755

AlanCoding opened this issue Jun 20, 2018 · 4 comments · Fixed by #41760
Labels
affects_2.6 This issue/PR affects Ansible v2.6 affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team. tower_blocker Issues/pending fixes that are failing Tower integration tests or should otherwise block a release

Comments

@AlanCoding
Copy link
Member

SUMMARY

In recent release candidates the --diff option stopped working (meaning that it became non-functional), this was tested for the file module.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible-playbook CLI
--diff CLI option

ANSIBLE VERSION

tested and confirmed bug in environments:

ansible --version
ansible 2.7.0.dev0
  config file = None
  configured module search path = [u'/Users/alancoding/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/alancoding/.virtualenvs/ansible/lib/python2.7/site-packages/ansible-2.7.0.dev0-py2.7.egg/ansible
  executable location = /Users/alancoding/.virtualenvs/ansible/bin/ansible
  python version = 2.7.11 (default, Oct 17 2016, 14:59:40) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]
ansible --version
ansible 2.6.0rc3
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
CONFIGURATION

No output from ansible-config dump --only-changed

OS / ENVIRONMENT

tested as local action in CentOS container

cat /proc/version
Linux version 4.9.87-linuxkit-aufs (root@95fa5ec30613) (gcc version 6.4.0 (Alpine 6.4.0) ) #1 SMP Wed Mar 14 15:12:16 UTC 2018

installed via

rpm -Uvh https://releases.ansible.com/ansible/rpm/preview/epel-7-x86_64/ansible-2.6.0-0.1003.rc3.el7.ans.noarch.rpm

Also confirmed on Mac

STEPS TO REPRODUCE

playbook, file.yml

---

- hosts: all
  gather_facts: false
  vars:
    file_name: '/tmp/test'
  tasks:
    - file:
        path: '{{file_name}}'
        state: touch

command:

ansible-playbook -i localhost, --connection local file.yml --diff
EXPECTED RESULTS

Result from 2.5.3

PLAY [all] **************************************************************************************************************************************************************************

TASK [file] *************************************************************************************************************************************************************************
--- before
+++ after
@@ -1,4 +1,4 @@
 {
     "path": "/tmp/test",
-    "state": "file"
+    "state": "touch"
 }

changed: [localhost]

PLAY RECAP **************************************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0 
ACTUAL RESULTS
PLAY [all] **************************************************************************************************************************************************************************

TASK [file] *************************************************************************************************************************************************************************
changed: [localhost]

PLAY RECAP **************************************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0   

@ansibot
Copy link
Contributor

ansibot commented Jun 20, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 20, 2018
@AlanCoding
Copy link
Member Author

Source of the playbook https://github.com/jlaska/ansible-playbooks/blob/master/file.yml

@wenottingham this is a blocker for Tower, and has been seen in test systems.

I first thought this was the same as #34226, but has 2.4 on it, and it was working as of 2.5, so that makes it a recent regression, and the module is different anyway.

@sivel
Copy link
Member

sivel commented Jun 20, 2018

This was introduced in 4e2876b

cc @abadger

@AlanCoding AlanCoding changed the title --diff flag stopped producing the diff --diff flag stopped producing the diff from file module Jun 20, 2018
@sivel sivel added tower_blocker Issues/pending fixes that are failing Tower integration tests or should otherwise block a release affects_2.6 This issue/PR affects Ansible v2.6 and removed needs_triage Needs a first human triage before being processed. labels Jun 20, 2018
abadger added a commit to abadger/ansible that referenced this issue Jun 20, 2018
jborean93 pushed a commit to jborean93/ansible that referenced this issue Jun 20, 2018
abadger added a commit to abadger/ansible that referenced this issue Jun 20, 2018
Fixes ansible#41755
(cherry picked from commit 8bd245a)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
@AlanCoding
Copy link
Member Author

@abadger I confirmed that installing from current devel fixes the test that discovered this. With the 2.6 backport, that will resolve this completely. That was crazy fast, you are awesome!

mattclay pushed a commit that referenced this issue Jun 21, 2018
Fixes #41755
(cherry picked from commit 8bd245a)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
jacum pushed a commit to jacum/ansible that referenced this issue Jun 26, 2018
kbreit pushed a commit to kbreit/ansible that referenced this issue Jul 3, 2018
Fixes ansible#41755
(cherry picked from commit 8bd245a)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
@ansible ansible locked and limited conversation to collaborators Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team. tower_blocker Issues/pending fixes that are failing Tower integration tests or should otherwise block a release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants