Closed
Description
Summary
copy
with remote_src
does not show a diff. The docs say that the copy module has full diff support, but this doesn't feel like full diff support.
I'd also like to point out my existing pull request which fixes other missing diff output from the same module which has been neglected for over a year
Issue Type
Bug Report
Component Name
copy
Ansible Version
$ ansible --version
ansible [core 2.17.3]
config file = /Users/simon/unity/unity-ansible-gitlab/ansible.cfg
configured module search path = ['/Users/simon/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/simon/.local/lib/python3.12/site-packages/ansible
ansible collection location = /Users/simon/unity/unity-ansible-gitlab/collections
executable location = /Users/simon/.local/bin/ansible
python version = 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 16.0.0 (clang-1600.0.26.3)] (/Users/simon/.local/bin/python3.12)
jinja version = 3.1.4
libyaml = True
Configuration
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
ANSIBLE_FORCE_COLOR(my-config-file) = True
ANSIBLE_PIPELINING(my-config-file) = True
CACHE_PLUGIN(my-config-file) = jsonfile
CACHE_PLUGIN_CONNECTION(my-config-file) = $HOME/.cache/ansible
CACHE_PLUGIN_TIMEOUT(my-config-file) = 86400
COLLECTIONS_PATHS(my-config-file) = ['my-ansible-directory/collections']
CONFIG_FILE() = my-config-file
DEFAULT_FORKS(my-config-file) = 200
DEFAULT_GATHERING(my-config-file) = smart
DEFAULT_HOST_LIST(my-config-file) = ['my-ansible-directory/inventory.d']
DEFAULT_MANAGED_STR(my-config-file) = This file is managed by Ansible.%n
DEFAULT_ROLES_PATH(my-config-file) = ['my-ansible-directory/roles']
DIFF_ALWAYS(my-config-file) = True
EDITOR(env: EDITOR) = vim
HOST_KEY_CHECKING(my-config-file) = False
CACHE:
=====
jsonfile:
________
_timeout(my-config-file) = 86400
_uri(my-config-file) = /Users/simon/.cache/ansible
CONNECTION:
==========
local:
_____
pipelining(my-config-file) = True
paramiko_ssh:
____________
host_key_checking(my-config-file) = False
ssh_args(my-config-file) = -o ControlMaster=auto -o C
6C92
>
psrp:
____
pipelining(my-config-file) = True
ssh:
___
host_key_checking(my-config-file) = False
pipelining(my-config-file) = True
ssh_args(my-config-file) = -o ControlMaster=auto -o ControlPersist=60s
winrm:
_____
pipelining(my-config-file) = True
OS / Environment
macos 15.0
Steps to Reproduce
- name: play
hosts: localhost
gather_facts: false
tasks:
- name: remote copy
ansible.builtin.copy:
src: /etc/hosts
dest: /tmp/hosts
remote_src: true
mode: "0644"
diff: true
Expected Results
I expected to see a diff.
Actual Results
PLAY [play] ************************************************************************************************************************************************
TASK [remote copy] *****************************************************************************************************************************************
changed: [localhost]
PLAY RECAP *************************************************************************************************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Code of Conduct
- I agree to follow the Ansible Code of Conduct