mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 07:35:31 +01:00
Add delegate_to option to each syncronized task
Signed-off-by: Hideki Saito <saito@fgrep.org>
This commit is contained in:
parent
b7414027c5
commit
5913800125
3 changed files with 33 additions and 5 deletions
|
|
@ -51,10 +51,22 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/linux/{0}/1
|
testFormat: devel/linux/{0}/1
|
||||||
targets:
|
targets:
|
||||||
|
- name: CentOS 6
|
||||||
|
test: centos6
|
||||||
|
- name: CentOS 7
|
||||||
|
test: centos7
|
||||||
|
- name: CentOS 8
|
||||||
|
test: centos8
|
||||||
- name: Fedora 33
|
- name: Fedora 33
|
||||||
test: fedora33
|
test: fedora33
|
||||||
- name: Fedora 34
|
- name: Fedora 34
|
||||||
test: fedora34
|
test: fedora34
|
||||||
|
- name: openSUSE 15 py2
|
||||||
|
test: opensuse15py2
|
||||||
|
- name: openSUSE 15 py3
|
||||||
|
test: opensuse15
|
||||||
|
- name: Ubuntu 18.04
|
||||||
|
test: ubuntu1804
|
||||||
- name: Ubuntu 20.04
|
- name: Ubuntu 20.04
|
||||||
test: ubuntu2004
|
test: ubuntu2004
|
||||||
- stage: Docker_2_11
|
- stage: Docker_2_11
|
||||||
|
|
@ -147,6 +159,8 @@ stages:
|
||||||
targets:
|
targets:
|
||||||
- name: MacOS 11.1
|
- name: MacOS 11.1
|
||||||
test: macos/11.1
|
test: macos/11.1
|
||||||
|
- name: RHEL 7.9
|
||||||
|
test: rhel/7.9
|
||||||
- name: RHEL 8.4
|
- name: RHEL 8.4
|
||||||
test: rhel/8.4
|
test: rhel/8.4
|
||||||
- name: FreeBSD 12.2
|
- name: FreeBSD 12.2
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
---
|
---
|
||||||
trivial:
|
trivial:
|
||||||
- CI tests - remove unsupported platform from devel branch tests.
|
- CI tests - fix integration test for synchronize to address changing behavior of devel.
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,23 @@
|
||||||
package:
|
package:
|
||||||
name: rsync
|
name: rsync
|
||||||
when: ansible_distribution != "MacOSX"
|
when: ansible_distribution != "MacOSX"
|
||||||
- name: cleanup old files
|
- name: Clean up the working directory and files
|
||||||
shell: rm -rf {{output_dir}}/*
|
file:
|
||||||
|
path: "{{ output_dir }}"
|
||||||
|
state: absent
|
||||||
|
- name: Create the working directory
|
||||||
|
file:
|
||||||
|
path: "{{ output_dir }}"
|
||||||
|
state: directory
|
||||||
- name: create test new files
|
- name: create test new files
|
||||||
copy: dest={{output_dir}}/{{item}} mode=0644 content="hello world"
|
copy: dest={{output_dir}}/{{item}} mode=0644 content="hello world"
|
||||||
with_items:
|
with_items:
|
||||||
- foo.txt
|
- foo.txt
|
||||||
- bar.txt
|
- bar.txt
|
||||||
- stat:
|
|
||||||
path: "{{ output_dir }}"
|
|
||||||
- name: synchronize file to new filename
|
- name: synchronize file to new filename
|
||||||
synchronize: src={{output_dir}}/foo.txt dest={{output_dir}}/foo.result
|
synchronize: src={{output_dir}}/foo.txt dest={{output_dir}}/foo.result
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- '''changed'' in sync_result'
|
- '''changed'' in sync_result'
|
||||||
|
|
@ -36,6 +41,7 @@
|
||||||
- name: test that the file is not copied a second time
|
- name: test that the file is not copied a second time
|
||||||
synchronize: src={{output_dir}}/foo.txt dest={{output_dir}}/foo.result
|
synchronize: src={{output_dir}}/foo.txt dest={{output_dir}}/foo.result
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- sync_result.changed == False
|
- sync_result.changed == False
|
||||||
|
|
@ -52,6 +58,7 @@
|
||||||
dest: '{{output_dir}}/foo.result'
|
dest: '{{output_dir}}/foo.result'
|
||||||
mode: push
|
mode: push
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- '''changed'' in sync_result'
|
- '''changed'' in sync_result'
|
||||||
|
|
@ -77,6 +84,7 @@
|
||||||
dest: '{{output_dir}}/foo.result'
|
dest: '{{output_dir}}/foo.result'
|
||||||
mode: push
|
mode: push
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- sync_result.changed == False
|
- sync_result.changed == False
|
||||||
|
|
@ -93,6 +101,7 @@
|
||||||
dest: '{{output_dir}}/foo.result'
|
dest: '{{output_dir}}/foo.result'
|
||||||
mode: pull
|
mode: pull
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- '''changed'' in sync_result'
|
- '''changed'' in sync_result'
|
||||||
|
|
@ -118,6 +127,7 @@
|
||||||
dest: '{{output_dir}}/foo.result'
|
dest: '{{output_dir}}/foo.result'
|
||||||
mode: pull
|
mode: pull
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- sync_result.changed == False
|
- sync_result.changed == False
|
||||||
|
|
@ -134,6 +144,7 @@
|
||||||
- foo.txt
|
- foo.txt
|
||||||
- bar.txt
|
- bar.txt
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- sync_result.changed
|
- sync_result.changed
|
||||||
|
|
@ -156,6 +167,7 @@
|
||||||
- name: synchronize files using rsync_path (issue#7182)
|
- name: synchronize files using rsync_path (issue#7182)
|
||||||
synchronize: src={{output_dir}}/foo.txt dest={{output_dir}}/foo.rsync_path rsync_path="sudo rsync"
|
synchronize: src={{output_dir}}/foo.txt dest={{output_dir}}/foo.rsync_path rsync_path="sudo rsync"
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- '''changed'' in sync_result'
|
- '''changed'' in sync_result'
|
||||||
|
|
@ -188,6 +200,7 @@
|
||||||
dest: '{{output_dir}}/{{item}}/foo.txt'
|
dest: '{{output_dir}}/{{item}}/foo.txt'
|
||||||
with_items:
|
with_items:
|
||||||
- directory_a
|
- directory_a
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- name: synchronize files using link_dest
|
- name: synchronize files using link_dest
|
||||||
synchronize:
|
synchronize:
|
||||||
src: '{{output_dir}}/directory_a/foo.txt'
|
src: '{{output_dir}}/directory_a/foo.txt'
|
||||||
|
|
@ -195,6 +208,7 @@
|
||||||
link_dest:
|
link_dest:
|
||||||
- '{{output_dir}}/directory_a'
|
- '{{output_dir}}/directory_a'
|
||||||
register: sync_result
|
register: sync_result
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
- name: get stat information for directory_a
|
- name: get stat information for directory_a
|
||||||
stat:
|
stat:
|
||||||
path: '{{ output_dir }}/directory_a/foo.txt'
|
path: '{{ output_dir }}/directory_a/foo.txt'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue