Skip to content

Commit

Permalink
Replace synchronize module with fetch
Browse files Browse the repository at this point in the history
Although rsync is the best it introduced an unnecessary dependency. Instead,
the 'fetch' module is now used to copy files from remote host to the
controller.
  • Loading branch information
gadamiak committed Apr 17, 2018
1 parent 16e52b2 commit bc95631
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Requirements
------------

* `sosreport` utility present on the remote host, installed if missing.
* `rsync` utility present on the controller, **not installed** if missing.

Role Variables
--------------
Expand Down
13 changes: 9 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@
{% endif %}
environment: "{{ sosreport_env|default(omit) }}"

- name: Copy sosreport to {{ sosreport_local_dir }} on the controller
synchronize:
src: "{{ sosreport_remote_dir }}/"
- name: Find files to fetch
command: ls -1 {{ sosreport_remote_dir }}
register: sosreport_files

- name: Fetch files to {{ sosreport_local_dir }} on the controller
fetch:
src: "{{ sosreport_remote_dir }}/{{ item }}"
dest: "{{ sosreport_local_dir }}/"
mode: pull
flat: yes
with_items: "{{ sosreport_files.stdout_lines }}"

- name: Remove {{ sosreport_remote_dir }} directory
file:
Expand Down

0 comments on commit bc95631

Please sign in to comment.