mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
[PR #11719/66886d08 backport][stable-12] integration tests: remove CentOS conditionals - part 2 (#11730)
integration tests: remove CentOS conditionals - part 2 (#11719)
* test(integration): remove CentOS references - part 2
* adjustments from review
(cherry picked from commit 66886d08f5)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -39,20 +39,7 @@
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
# selectattr not available on Jinja 2.2 provided by CentOS 6
|
||||
# hence the two following tasks (set_fact/assert) are used
|
||||
# - (result['sessions'] | selectattr('ID', 'match', '^' ~ session_id ~ '$') | first)['Name'] == 'testsession'
|
||||
|
||||
- name: search created session
|
||||
set_fact:
|
||||
test_session_found: true
|
||||
loop: "{{ result['sessions'] }}"
|
||||
when: "item.get('ID') == session_id and item.get('Name') == 'testsession'"
|
||||
|
||||
- name: ensure session was created
|
||||
assert:
|
||||
that:
|
||||
- test_session_found|default(false)
|
||||
- (result['sessions'] | selectattr('ID', 'match', '^' ~ session_id ~ '$') | first)['Name'] == 'testsession'
|
||||
|
||||
- name: fetch info about a session
|
||||
consul_session:
|
||||
@@ -93,21 +80,7 @@
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
# selectattr and equalto not available on Jinja 2.2 provided by CentOS 6
|
||||
# hence the two following tasks (command/assert) are used
|
||||
# - (result['sessions'] | selectattr('ID', 'equalto', session_id) | list | length) == 0
|
||||
|
||||
- name: search deleted session
|
||||
command: echo 'session found'
|
||||
loop: "{{ result['sessions'] }}"
|
||||
when: "item.get('ID') == session_id and item.get('Name') == 'testsession'"
|
||||
register: search_deleted
|
||||
|
||||
- name: ensure session was deleted
|
||||
assert:
|
||||
that:
|
||||
- search_deleted is skipped # each iteration is skipped
|
||||
- search_deleted is not changed # and then unchanged
|
||||
- (result['sessions'] | selectattr('ID', 'equalto', session_id) | list | length) == 0
|
||||
|
||||
- name: ensure session can be created with a ttl
|
||||
consul_session:
|
||||
|
||||
@@ -14,13 +14,6 @@
|
||||
consul_uri: https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_{{ ansible_facts.system | lower }}_{{ consul_arch }}.zip
|
||||
consul_cmd: '{{ remote_tmp_dir }}/consul'
|
||||
block:
|
||||
- name: Install requests<2.20 (CentOS/RHEL 6)
|
||||
pip:
|
||||
name: requests<2.20
|
||||
extra_args: "-c {{ remote_constraints }}"
|
||||
register: result
|
||||
until: result is success
|
||||
when: ansible_facts.distribution_file_variety|default() == 'RedHat' and ansible_facts.distribution_major_version is version('6', '<=')
|
||||
- name: Install py-consul
|
||||
pip:
|
||||
name: py-consul
|
||||
|
||||
Reference in New Issue
Block a user