mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 23:55:19 +01:00
Compare commits
7 commits
342a38a243
...
0409a0b81e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0409a0b81e | ||
|
|
2f699307c7 | ||
|
|
7dd5087e7b | ||
|
|
8cdf51b3b3 | ||
|
|
0b6eb4506b | ||
|
|
dea22dcf4e | ||
|
|
dd3b97069b |
4 changed files with 75 additions and 112 deletions
|
|
@ -51,16 +51,29 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/linux/{0}/1
|
testFormat: devel/linux/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: CentOS 7
|
|
||||||
test: centos7
|
|
||||||
- name: Fedora 38
|
- name: Fedora 38
|
||||||
test: fedora38
|
test: fedora38
|
||||||
- name: openSUSE 15 py3
|
|
||||||
test: opensuse15
|
|
||||||
- name: Ubuntu 20.04
|
- name: Ubuntu 20.04
|
||||||
test: ubuntu2004
|
test: ubuntu2004
|
||||||
- name: Ubuntu 22.04
|
- name: Ubuntu 22.04
|
||||||
test: ubuntu2204
|
test: ubuntu2204
|
||||||
|
- stage: Docker_2_16
|
||||||
|
displayName: Docker 2.16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.16/linux/{0}/1
|
||||||
|
targets:
|
||||||
|
- name: CentOS 7
|
||||||
|
test: centos7
|
||||||
|
- name: Fedora 38
|
||||||
|
test: fedora38
|
||||||
|
- name: Ubuntu 20.04
|
||||||
|
test: ubuntu2004
|
||||||
|
- name: Ubuntu 22.04
|
||||||
|
test: ubuntu2204
|
||||||
|
|
||||||
- stage: Docker_2_15
|
- stage: Docker_2_15
|
||||||
displayName: Docker 2.15
|
displayName: Docker 2.15
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -141,44 +154,6 @@ stages:
|
||||||
test: ubuntu1804
|
test: ubuntu1804
|
||||||
- name: Ubuntu 20.04
|
- name: Ubuntu 20.04
|
||||||
test: ubuntu2004
|
test: ubuntu2004
|
||||||
- stage: Docker_2_11
|
|
||||||
displayName: Docker 2.11
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.11/linux/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: CentOS 6
|
|
||||||
test: centos6
|
|
||||||
- name: CentOS 7
|
|
||||||
test: centos7
|
|
||||||
- name: openSUSE 15 py2
|
|
||||||
test: opensuse15py2
|
|
||||||
- name: openSUSE 15 py3
|
|
||||||
test: opensuse15
|
|
||||||
- name: Ubuntu 18.04
|
|
||||||
test: ubuntu1804
|
|
||||||
- stage: Docker_2_10
|
|
||||||
displayName: Docker 2.10
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.10/linux/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: CentOS 6
|
|
||||||
test: centos6
|
|
||||||
- name: CentOS 7
|
|
||||||
test: centos7
|
|
||||||
- name: openSUSE 15 py2
|
|
||||||
test: opensuse15py2
|
|
||||||
- name: openSUSE 15 py3
|
|
||||||
test: opensuse15
|
|
||||||
- name: Ubuntu 16.04
|
|
||||||
test: ubuntu1604
|
|
||||||
- name: Ubuntu 18.04
|
|
||||||
test: ubuntu1804
|
|
||||||
- stage: Docker_2_9
|
- stage: Docker_2_9
|
||||||
displayName: Docker 2.9
|
displayName: Docker 2.9
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -209,16 +184,21 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/{0}/1
|
testFormat: devel/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: MacOS 13.2
|
- name: RHEL 9.3
|
||||||
test: macos/13.2
|
test: rhel/9.3
|
||||||
- name: RHEL 7.9
|
- stage: Remote_2_16
|
||||||
test: rhel/7.9
|
displayName: Remote 2.16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.16/{0}/1
|
||||||
|
targets:
|
||||||
- name: RHEL 8.8
|
- name: RHEL 8.8
|
||||||
test: rhel/8.8
|
test: rhel/8.8
|
||||||
- name: RHEL 9.2
|
- name: RHEL 9.2
|
||||||
test: rhel/9.2
|
test: rhel/9.2
|
||||||
- name: FreeBSD 13.2
|
|
||||||
test: freebsd/13.2
|
|
||||||
- stage: Remote_2_15
|
- stage: Remote_2_15
|
||||||
displayName: Remote 2.15
|
displayName: Remote 2.15
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -227,18 +207,12 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: 2.15/{0}/1
|
testFormat: 2.15/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: MacOS 13.2
|
|
||||||
test: macos/13.2
|
|
||||||
- name: RHEL 7.9
|
- name: RHEL 7.9
|
||||||
test: rhel/7.9
|
test: rhel/7.9
|
||||||
- name: RHEL 8.7
|
- name: RHEL 8.7
|
||||||
test: rhel/8.7
|
test: rhel/8.7
|
||||||
- name: RHEL 9.1
|
- name: RHEL 9.1
|
||||||
test: rhel/9.1
|
test: rhel/9.1
|
||||||
- name: FreeBSD 12.4
|
|
||||||
test: freebsd/12.4
|
|
||||||
- name: FreeBSD 13.1
|
|
||||||
test: freebsd/13.1
|
|
||||||
- stage: Remote_2_14
|
- stage: Remote_2_14
|
||||||
displayName: Remote 2.14
|
displayName: Remote 2.14
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -247,18 +221,10 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: 2.14/{0}/1
|
testFormat: 2.14/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: MacOS 12.0
|
|
||||||
test: macos/12.0
|
|
||||||
- name: RHEL 7.9
|
- name: RHEL 7.9
|
||||||
test: rhel/7.9
|
test: rhel/7.9
|
||||||
- name: RHEL 8.6
|
- name: RHEL 8.6
|
||||||
test: rhel/8.6
|
test: rhel/8.6
|
||||||
- name: RHEL 9.0
|
|
||||||
test: rhel/9.0
|
|
||||||
- name: FreeBSD 12.3
|
|
||||||
test: freebsd/12.3
|
|
||||||
- name: FreeBSD 13.1
|
|
||||||
test: freebsd/13.1
|
|
||||||
- stage: Remote_2_13
|
- stage: Remote_2_13
|
||||||
displayName: Remote 2.13
|
displayName: Remote 2.13
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -267,16 +233,10 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: 2.13/{0}/1
|
testFormat: 2.13/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: MacOS 12.0
|
|
||||||
test: macos/12.0
|
|
||||||
- name: RHEL 7.9
|
- name: RHEL 7.9
|
||||||
test: rhel/7.9
|
test: rhel/7.9
|
||||||
- name: RHEL 8.5
|
- name: RHEL 8.5
|
||||||
test: rhel/8.5
|
test: rhel/8.5
|
||||||
- name: FreeBSD 12.3
|
|
||||||
test: freebsd/12.3
|
|
||||||
- name: FreeBSD 13.0
|
|
||||||
test: freebsd/13.0
|
|
||||||
- stage: Remote_2_12
|
- stage: Remote_2_12
|
||||||
displayName: Remote 2.12
|
displayName: Remote 2.12
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -285,40 +245,10 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: 2.12/{0}/1
|
testFormat: 2.12/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: MacOS 11.1
|
|
||||||
test: macos/11.1
|
|
||||||
- name: RHEL 7.9
|
- name: RHEL 7.9
|
||||||
test: 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 13.0
|
|
||||||
test: freebsd/13.0
|
|
||||||
- stage: Remote_2_11
|
|
||||||
displayName: Remote 2.11
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.11/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: MacOS 11.1
|
|
||||||
test: macos/11.1
|
|
||||||
- name: RHEL 7.9
|
|
||||||
test: rhel/7.9
|
|
||||||
- name: RHEL 8.3
|
|
||||||
test: rhel/8.3
|
|
||||||
- stage: Remote_2_10
|
|
||||||
displayName: Remote 2.10
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.10/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: RHEL 7.9
|
|
||||||
test: rhel/7.9
|
|
||||||
- name: RHEL 8.2
|
|
||||||
test: rhel/8.2
|
|
||||||
- stage: Remote_2_9
|
- stage: Remote_2_9
|
||||||
displayName: Remote 2.9
|
displayName: Remote 2.9
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -339,10 +269,6 @@ stages:
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Remote_2_9
|
- Remote_2_9
|
||||||
- Docker_2_9
|
- Docker_2_9
|
||||||
- Remote_2_10
|
|
||||||
- Docker_2_10
|
|
||||||
- Remote_2_11
|
|
||||||
- Docker_2_11
|
|
||||||
- Remote_2_12
|
- Remote_2_12
|
||||||
- Docker_2_12
|
- Docker_2_12
|
||||||
- Remote_2_13
|
- Remote_2_13
|
||||||
|
|
@ -351,6 +277,8 @@ stages:
|
||||||
- Docker_2_14
|
- Docker_2_14
|
||||||
- Remote_2_15
|
- Remote_2_15
|
||||||
- Docker_2_15
|
- Docker_2_15
|
||||||
|
- Remote_2_16
|
||||||
|
- Docker_2_16
|
||||||
- Remote_devel
|
- Remote_devel
|
||||||
- Docker_devel
|
- Docker_devel
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- synchronize - user-defined ``--out-format`` in ``rsync_opts`` is now honored in the returned output. (https://github.com/ansible-collections/ansible.posix/pull/428)
|
||||||
3
changelogs/fragments/508_ci_update.yml
Normal file
3
changelogs/fragments/508_ci_update.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
trivial:
|
||||||
|
- "Refactoring remote CI targets."
|
||||||
|
|
@ -348,6 +348,7 @@ EXAMPLES = r'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import errno
|
import errno
|
||||||
|
import re
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils._text import to_bytes, to_native
|
from ansible.module_utils._text import to_bytes, to_native
|
||||||
|
|
@ -578,8 +579,19 @@ def main():
|
||||||
module.fail_json(msg='Hardlinking into a subdirectory of the source would cause recursion. %s and %s' % (destination_path, dest))
|
module.fail_json(msg='Hardlinking into a subdirectory of the source would cause recursion. %s and %s' % (destination_path, dest))
|
||||||
cmd.append('--link-dest=%s' % link_path)
|
cmd.append('--link-dest=%s' % link_path)
|
||||||
|
|
||||||
changed_marker = '<<CHANGED>>'
|
# find the last specified out-format
|
||||||
cmd.append('--out-format=%s' % shlex_quote(changed_marker + '%i %n%L'))
|
out_format = ''
|
||||||
|
for rsync_opt in rsync_opts:
|
||||||
|
if rsync_opt.startswith('--out-format='):
|
||||||
|
out_format = rsync_opt.replace('--out-format=', '', 1)
|
||||||
|
|
||||||
|
# force a known out-format so we can test for changes and return a known format of diff
|
||||||
|
diff_marker = 'DIFF'
|
||||||
|
if out_format == '' or module._diff:
|
||||||
|
diff_detail = '%n%L'
|
||||||
|
else:
|
||||||
|
diff_detail = ''
|
||||||
|
cmd.append('--out-format=%s' % shlex_quote('%s//%s//%%i//%s' % (out_format, diff_marker, diff_detail)))
|
||||||
|
|
||||||
# expand the paths
|
# expand the paths
|
||||||
if '@' not in source:
|
if '@' not in source:
|
||||||
|
|
@ -611,18 +623,36 @@ def main():
|
||||||
if rc:
|
if rc:
|
||||||
return module.fail_json(msg=err, rc=rc, cmd=cmdstr)
|
return module.fail_json(msg=err, rc=rc, cmd=cmdstr)
|
||||||
|
|
||||||
if link_dest:
|
changed = False
|
||||||
# a leading period indicates no change
|
diff = []
|
||||||
changed = (changed_marker + '.') not in out
|
out_lines = []
|
||||||
else:
|
# remove forced out-format suffix, check for file changes
|
||||||
changed = changed_marker in out
|
for line in out.split('\n'):
|
||||||
|
match = re.match('(.*)//%s//(...*?)//(.*)$' % diff_marker, line)
|
||||||
|
if match:
|
||||||
|
default_diff = '%s %s' % (match.group(2), match.group(3))
|
||||||
|
|
||||||
out_clean = out.replace(changed_marker, '')
|
if module._diff:
|
||||||
out_lines = out_clean.split('\n')
|
diff.append(default_diff)
|
||||||
|
|
||||||
|
if out_format == '':
|
||||||
|
out_lines.append(default_diff)
|
||||||
|
else:
|
||||||
|
out_lines.append(match.group(1))
|
||||||
|
|
||||||
|
# a period in the first position indicates no changes to the file's contents
|
||||||
|
# a period in every other position from the third onward indicates no attribute changes
|
||||||
|
if not re.match(r'\..\.*$', match.group(2)):
|
||||||
|
changed = True
|
||||||
|
else:
|
||||||
|
out_lines.append(line)
|
||||||
|
|
||||||
|
out_clean = '\n'.join(out_lines)
|
||||||
while '' in out_lines:
|
while '' in out_lines:
|
||||||
out_lines.remove('')
|
out_lines.remove('')
|
||||||
|
|
||||||
if module._diff:
|
if module._diff:
|
||||||
diff = {'prepared': out_clean}
|
diff = {'prepared': '\n'.join(diff)}
|
||||||
return module.exit_json(changed=changed, msg=out_clean,
|
return module.exit_json(changed=changed, msg=out_clean,
|
||||||
rc=rc, cmd=cmdstr, stdout_lines=out_lines,
|
rc=rc, cmd=cmdstr, stdout_lines=out_lines,
|
||||||
diff=diff)
|
diff=diff)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue