Skip to content

Commit

Permalink
Merge pull request #4 from srz-zumix/feature/bash_cp_test_remote_src
Browse files Browse the repository at this point in the history
add bash cp test remote_src
  • Loading branch information
srz-zumix committed Jan 10, 2022
2 parents 5b922cb + aa8c64a commit 6ced89b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
14 changes: 13 additions & 1 deletion roles/bash-cp-test/tasks/test-loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@
src: "bar.sh"
dest: "{{ test_dir }}/test.sh"
mode: 0755
when: bar_override_copy_module
when:
- bar_override_copy_module
- not bar_override__copy_module_remote_src

- name: Override bar (copy module) (remote_src)
copy:
remote_src: true
src: "{{ test_dir }}/bar.sh"
dest: "{{ test_dir }}/test.sh"
mode: 0755
when:
- bar_override_copy_module
- bar_override__copy_module_remote_src

- name: ls
command: ls -i {{ test_dir }}
Expand Down
10 changes: 10 additions & 0 deletions roles/bash-cp-test/tasks/test-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@
- name: Test copy module
vars:
bar_override_copy_module: true
bar_override__copy_module_remote_src: false
log_file: "{{ ansible_env.HOME }}/log-copy-module.txt"
import_tasks: test-loop.yml

- name: Test copy module (remote_src)
vars:
bar_override_copy_module: true
bar_override__copy_module_remote_src: true
log_file: "{{ ansible_env.HOME }}/log-copy-module-remote-src.txt"
import_tasks: test-loop.yml

- name: Test shell cp
vars:
bar_override_copy_module: false
bar_override__copy_module_remote_src: false
log_file: "{{ ansible_env.HOME }}/log-shell-copy.txt"
import_tasks: test-loop.yml

Expand All @@ -32,6 +41,7 @@
register: result_file
with_items:
- log-copy-module.txt
- log-copy-module-remote-src.txt
- log-shell-copy.txt

- name: Show result
Expand Down

0 comments on commit 6ced89b

Please sign in to comment.