mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Migrate Linux CI roles to test targets. (#17997)
This commit is contained in:
parent
374e4348e4
commit
75e4645ee7
263 changed files with 53 additions and 53 deletions
32
test/integration/targets/until/tasks/main.yml
Normal file
32
test/integration/targets/until/tasks/main.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
- shell: '{{ ansible_python.executable }} -c "import tempfile; print(tempfile.mkstemp()[1])"'
|
||||
register: tempfilepath
|
||||
|
||||
- set_fact:
|
||||
until_tempfile_path: "{{ tempfilepath.stdout }}"
|
||||
|
||||
- name: loop with default retries
|
||||
shell: echo "run" >> {{ until_tempfile_path }} && wc -w < {{ until_tempfile_path }} | tr -d ' '
|
||||
register: runcount
|
||||
until: runcount.stdout | int == 3
|
||||
delay: 0.01
|
||||
|
||||
- assert:
|
||||
that: runcount.stdout | int == 3
|
||||
|
||||
- file: path="{{ until_tempfile_path }}" state=absent
|
||||
|
||||
- name: loop with specified max retries
|
||||
shell: echo "run" >> {{ until_tempfile_path }}
|
||||
until: 1==0
|
||||
retries: 5
|
||||
delay: 0.01
|
||||
ignore_errors: true
|
||||
|
||||
- name: validate output
|
||||
shell: wc -l < {{ until_tempfile_path }}
|
||||
register: runcount
|
||||
|
||||
- assert:
|
||||
that: runcount.stdout | int == 6 # initial + 5 retries
|
||||
|
||||
- file: path="{{ until_tempfile_path }}" state=absent
|
Loading…
Add table
Add a link
Reference in a new issue