Fix AnsibleUnsafeText when copying files larger than SMALL_FILE_LIMIT#1110
Conversation
|
refs #1046 |
|
related to #1087. @jrosser thank for these PRs.
|
|
@moreati Yes please do rebase / adjust any of my PR as needed to get them suitable to merge. Adding https://github.com/jrosser to the contributors list would be nice - thankyou. |
In progress. Notes to self
|
|
Like #1087 this only occurs in a - hosts: localhost
gather_facts: false
vars:
chonkers:
- {src: ~/tmp/150kiB_seed_1234_v1, dest: /tmp/150kiB_seed_1234_v1}
- {src: ~/tmp/150kiB_seed_1234_v1.copy, dest: /tmp/150kiB_seed_1234_v1}
- {src: ~/tmp/150kiB_seed_1234_v1, dest: /tmp/150kiB_seed_1234_v1.data}
- {src: ~/tmp/150kiB_seed_1234_v1.copy, dest: /tmp/150kiB_seed_1234_v1.data}
tasks:
- copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: u=rw,go=r
with_items: "{{ chonkers }}"
- name: Cleanup 1
file:
path: "{{ item.dest }}"
state: absent
with_items: "{{ chonkers }}" |
This is in anticipation of mitogen-hq#1110, which only exhibits inside a with_items: loop. For this refactor `loop:` is used, to confirm the refactored tests are still correct. A subsequent commit will change them to with_items. The content of the files and their SHA1 checksums are unchanged.
Small files are carried in-band in the communication between controller and remote, with larger files being copied by falling back to a more traditional ansible put_file mechanism. This large file code path was missed in b822f20.
|
Confirm that the loop driven version of tests/ansible/integration/copy.yml in moreati@ce1acce fails if all |
The bug was fixed in a previous commit by Jonathan Rosser. This adds testing. The bug is only triggered when the copy module is used inside a `with_items:` loop and the destination filename has an extension. A `loop:` loop is not sufficient. refs mitogen-hq#1110
|
@jrosser I think https://github.com/moreati/mitogen/tree/unsafe-large-copy is ready for you to update your branch with. It turns out the test suite already had tests for large file copies, but they weren't inside a |
b5e9784 to
5af6534
Compare
This is in anticipation of mitogen-hq#1110, which only exhibits inside a with_items: loop. For this refactor `loop:` is used, to confirm the refactored tests are still correct. A subsequent commit will change them to with_items. The content of the files and their SHA1 checksums are unchanged.
The bug was fixed in a previous commit by Jonathan Rosser. This adds testing. The bug is only triggered when the copy module is used inside a `with_items:` loop and the destination filename has an extension. A `loop:` loop is not sufficient. refs mitogen-hq#1110
Small files are carried in-band in the communication between controller and remote, with larger files being copied by falling back to
transfer_file(). This second code path was missed in b822f20.Reproducer extracted from original code that failed:
Make the files larger than 2^17 bytes to trigger a failure
Exception: